Skip to content

Commit 91515af

Browse files
Fix common/tools.py
Fixed `export_to_sql` function to close database connection after the operation has been completed.
1 parent 0945a05 commit 91515af

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fise/common/tools.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,7 @@ def export_to_sql(data: pd.DataFrame, database: str) -> None:
227227
raise QueryHandleError
228228

229229
data.to_sql(table, conn, if_exists="replace", index=False)
230+
231+
finally:
232+
conn.close()
233+
engine.dispose(close=True)

0 commit comments

Comments
 (0)