Skip to content

Commit 3035e97

Browse files
committed
Improve temp tables delete upon DAG timeout
1 parent 761da7b commit 3035e97

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,16 @@ def delete_temp_tables(scan_report_id: int, table_pairs: List[Tuple[str, int]])
239239
logging.error(f"Error deleting temporary tables: {str(e)}")
240240
raise e
241241

242-
def cleanup_temp_tables_for_scan_report(scan_report_id: int) -> list:
242+
243+
def cleanup_temp_tables_for_scan_report(scan_report_id: int) -> List[Tuple[str, int]]:
243244
"""
244245
Clean up temporary tables for a scan report.
245246
246-
Delete temporary tables (temp_data_dictionary and temp_field_values) for all tables
247-
linked to the provided scan_report_id in mapping_scanreporttable. Returns a list of
248-
(table_name, table_id) pairs that were cleaned up.
247+
Deletes temporary tables (temp_data_dictionary and temp_field_values) for all tables
248+
associated with the given scan_report_id in mapping_scanreporttable.
249+
250+
Returns:
251+
List of (table_name, table_id) tuples for the tables that were cleaned up.
249252
"""
250253

251254
query = """

0 commit comments

Comments
 (0)