Afiq Johari
10/17/2023, 5:17 PMNone
) and output (also set to None
).
As a workaround, I have set a DataFrame as both the input and output, although as you can see, these dataframes are not being used at all. Any best practices or tips on this kind of node?
def exec_test(companies: pd.DataFrame) -> pd.DataFrame:
companies_dummy = companies
try:
db_connection = connect_to_database()
print("Executing SP")
# execute the stored procedure
db_connection.execute(
"EXEC spUpdateData '20230601' 'parameter2' 'parameter3' 'etc' ")
db_connection.close()
print("SP completed")
except Exception as e:
# print error
print(f"Database connection error: {str(e)}")
return companies_dummy
Nok Lam Chan
10/17/2023, 5:22 PMAfiq Johari
10/17/2023, 5:47 PM