-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Use latest bundle version when clearing / re-running dag #50040
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
Use latest bundle version when clearing / re-running dag #50040
Conversation
be9640d
to
4bc265d
Compare
Making dag required helps me in apache#50040. It's always passed in all production code so, we can make the change. Should be thought of as private anyway. And making it kwarg only, well why not.
4bc265d
to
a9d9a3b
Compare
2e5cfa9
to
4ff97f8
Compare
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.
This looks good. My worry is that the clear_task_instances was not a private function. Is it ok to change it to a private function now?
Right -- understandable. My thinking is that it was not intentional to make that a public function, and that I am "fixing" that in this patch release. |
The function has been around for a while(Airflow 2 or 1 not sure) and it looks like people use it in their DAGs e.g #30237 and #19329 (comment) |
Btw |
79ac45b
to
bcaa368
Compare
When clearing a dag to be rerun, if the bundle is versioned, and bundle versioning is enabled for the dag, we should clear the bundle version (of the dag run) to be the latest bundle version seen for the dag. I removed the dag param. There's not much point in passing dag in as a param to this function since the TIs can be from different dags, so we have to look it up anyway. Moreover, they can be from different serdags associated with the same dag -- and that in particular is what makes this complicated and required me to go and use the SchedulerDagBag object.
7f19372
to
619938f
Compare
Co-authored-by: Tzu-ping Chung <[email protected]> (cherry picked from commit c069401)
Co-authored-by: Tzu-ping Chung <[email protected]> (cherry picked from commit c069401)
Use latest bundle version when clearing / re-running dag
When clearing a dag to be rerun, if the bundle is versioned, and bundle versioning is enabled for the dag, we should clear the bundle version (of the dag run) to be the latest bundle version seen for the dag.
I removed the dag param. There's not much point in passing dag in as a param to this function since the TIs can be from different dags, so we have to look it up anyway.
Moreover, they can be from different serdags associated with the same dag -- and that in particular is what makes this complicated and required me to go and use the SchedulerDagBag object.
Most of the ugliness of this PR comes from the fact that it requires that there be serialized dags which we sometimes do not create in our tests -- but which are always going to be there in production. And when I enable them in the test code, then it tends to require changes to the tests.
resolves: #49639