Repository navigation
Include task_reschedule in task_instance dependent tables for db clean - #71990
Conversation
ferruzzi
left a comment
There was a problem hiding this comment.
There's a good bit of overlap with #70923, which registers the same table with a guard and repairs the same test_no_models_missing bug. If #70923 lands first, then this PR can be reduced to the task_reschedule and asset_event fixes (plus their tests).
Committer: Please make sure that other PR is merged first and this gets rebased on top
8003fa9 to
907b127
Compare
|
Thanks for the review, @ferruzzi! Now that #70923 has landed on I've removed the duplicate
Ready for another look! |
46db6fa to
692dde7
Compare
|
@Alwaysgaurav1 - Needs another rebase, sorry. There are several PRs all poking in the same area with overlapping fixes and I'm trying to merge these in a way that minimizes the rebases, but some can't be helped. #73173 and #70923 stole a bit of your thunder by already merging part of what you did, but there is some work here that nobody else has caught though, and it's worth saving if you are willing to trim this down again. You added |
In Airflow 3, task_reschedule rows reference task_instance via ti_id foreign key with CASCADE delete. When cleaning task_instance rows via airflow db clean, task_reschedule rows must be cleaned and archived before task_instance rows are removed. - Add task_reschedule to task_instance.dependent_tables in airflow.utils.db_cleanup. - Add test coverage verifying task_reschedule cleanup and archiving when task_instance is cleaned.
692dde7 to
f54930e
Compare
|
Thanks for the guidance, @ferruzzi! I have rebased onto latest
Ready for another look! |
ferruzzi
left a comment
There was a problem hiding this comment.
Thanks, @Alwaysgaurav1 . I appreciate your patience while we sorted that out.
Approved pending CI success.
|
Actually, one small last request: can you trim down the PR description to reflect what's left in the PR? |
|
Done! I've trimmed down the description to focus specifically on the task_reschedule dependent table addition and its tests. Thanks for catching that, @ferruzzi! |
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Description
In Airflow 3,
task_reschedulerows referencetask_instancevia theti_idforeign key withCASCADEdelete. When runningairflow db cleanontask_instance,task_reschedulerows must be archived and cleaned prior to task instance removal.This PR:
"task_reschedule"totask_instance.dependent_tablesinairflow.utils.db_cleanupso that dependent reschedules are cleaned and archived before parent task instances.TestTaskRescheduleCleanup(test_db_cleanup.py) verifying both directtask_reschedulecleanup and cascading cleanup/archival whentask_instanceis cleaned.71990.bugfix.rst.Testing