Skip to content

Commit 2e0c9e5

Browse files
committed
Move handle_failure_and_cleanup_temp_tables to Db services to avoid in-function import
1 parent 94f4053 commit 2e0c9e5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/airflow/dags/libs/SR_processing/db_services.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ def cleanup_temp_tables_for_scan_report(scan_report_id: int) -> List[Tuple[str,
264264
delete_temp_tables(scan_report_id, table_pairs)
265265
return table_pairs
266266

267+
267268
def handle_failure_and_cleanup_temp_tables(context):
268269
"""
269270
Delete temporary tables when the DAG fails or times out.
@@ -326,4 +327,4 @@ def handle_failure_and_cleanup_temp_tables(context):
326327
)
327328

328329
except Exception as e:
329-
logging.error("Failed to delete temporary tables on failure: %s", str(e))
330+
logging.error("Failed to delete temporary tables on failure: %s", str(e))

0 commit comments

Comments
 (0)