Skip to content

Commit

Permalink
fixed number errors in saving & setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zabkwak committed Jul 25, 2022
1 parent 8b3e757 commit 431d10e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__pycache__

input
output
output*
.env
.projectenv
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from setuptools import setup

setup(
name="mat-facebook-ads-transformer",
version="1.0.2"
)
6 changes: 5 additions & 1 deletion src/range.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ def mid(self) -> float:
return (self.min + self.max) / 2

def __init__(self, min: int, max: int) -> None:
if type(min) is not int and type(min) is not float:
min = None
if type(max) is not int and type(max) is not float:
max = None
self.min = min
self.max = max

def to_string(self) -> str:
return f"{self.min}-{self.max}"
return f"{self.min or 0}-{self.max or 0}"
6 changes: 3 additions & 3 deletions src/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ def _process_archive(self) -> None:
row["page_id"],
row["page_name"],
row["currency"] or "NA",
str(spend.min),
str(spend.max),
str(spend.min or 0),
str(spend.max or 0),
row["bylines"],
row["id"],
row["id"],
spend.mid,
str(spend.mid or 0),
spend.to_string(),
self._get_first_list_value(row["languages"])
])
Expand Down

0 comments on commit 431d10e

Please sign in to comment.