-
Notifications
You must be signed in to change notification settings - Fork 6
Temp table delete #1254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Temp table delete #1254
Conversation
Merge from main
Merge from main
Merge from main
Merge from main
Merge from main
| query, parameters={"scan_report_id": scan_report_id} | ||
| ) | ||
|
|
||
| table_pairs = [(record[0], record[1]) for record in records] if records else [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to check - what is happening here?
Could you add a comment to describe it
Getting the first two values out of a list of lists is a little hard to understand why is all
| logging.error(f"Failed to update job status on skipped task: {str(e)}") | ||
|
|
||
|
|
||
| def delete_temp_tables_on_failure(context): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this should be more generic - but let's demo first.
⚡️ Optimization
PR Description
This PR enables the deletion of temporary tables created when a scan report upload fails. Currently, when a scan report upload fails, the temporary tables remain in the database and overtime cause consume space.
This was tested by having the DAG timeout set to one minute, observing the logs on airflow and checking the database to ensure the tables were deleted.
Related Issues or other material
Related #1228
Closes #1228
Screenshots, example outputs/behaviour etc.