Skip to content

Commit

Permalink
refactor(banks): always transform dates
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-awd committed Oct 21, 2023
1 parent 5460c83 commit de780c0
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions monopoly/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@


class StatementProcessor(PdfParser):
def __init__(
self, statement_config, file_path, pdf_config=None, transform_dates=True
):
def __init__(self, statement_config, file_path, pdf_config=None):
self.statement_config: StatementConfig = statement_config
self.file_path: str = file_path
self.pdf_config: Optional[PdfConfig] = pdf_config
self.transform_dates: bool = transform_dates

super().__init__(file_path=self.file_path, config=pdf_config)

Expand All @@ -39,11 +36,7 @@ def extract(self) -> Statement:

def transform(self, statement: Statement) -> DataFrame:
logger.info("Running transformation functions on DataFrame")
df = statement.df
statement_date = statement.statement_date

if self.transform_dates:
df = self._transform_date_to_iso(df, statement_date)
df = self._transform_date_to_iso(statement.df, statement.statement_date)

return df

Expand Down

0 comments on commit de780c0

Please sign in to comment.