Skip to content

Commit

Permalink
small type hints change
Browse files Browse the repository at this point in the history
  • Loading branch information
marinellirubens committed Jun 12, 2023
1 parent a037781 commit abe7116
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions magic_formula/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ def export_file(format, tickers_df: pandas.DataFrame, indexes, logger, number_of

def export_dataframe_formating(tickers_df: pandas.DataFrame,
logger: logging.Logger,
number_of_lines: int = None,
indexes: list = None) -> pandas.DataFrame:
number_of_lines: int = 0,
indexes: list = []) -> pandas.DataFrame:
"""Exports the ticker dataframe into an excel file
:param tickers_df: Dataframe with the stocks information
Expand All @@ -276,7 +276,7 @@ def export_dataframe_formating(tickers_df: pandas.DataFrame,

def export_dataframe_to_sql(tickers_df: pandas.DataFrame, logger: logging.Logger,
connection_string: str,
number_of_lines: int = None) -> None:
number_of_lines: int = 0) -> None:
"""Exportts the ticker dataframe into an postgresql
:param tickers_df: Dataframe with the stocks information
Expand All @@ -296,7 +296,7 @@ def export_dataframe_to_sql(tickers_df: pandas.DataFrame, logger: logging.Logger

engine = sqlalchemy.create_engine(connection_string)
tickers_df.to_sql('magicformula', engine, if_exists='append', index=False)
except sqlalchemy.exc.OperationalError as error:
except Exception as error:
logger.error(f'Error on conection with database {error}')


Expand Down

0 comments on commit abe7116

Please sign in to comment.