-
Notifications
You must be signed in to change notification settings - Fork 16.3k
feat: add only_new to dag clear function #59764
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?
feat: add only_new to dag clear function #59764
Conversation
505c4a3 to
c822b20
Compare
potiuk
left a comment
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.
It looks good
| from airflow.models.taskinstance import clear_task_instances | ||
|
|
||
| state: list[TaskInstanceState] = [] | ||
|
|
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.
LGTM, but Since it indeed touches core airflow definitions, I would love if other maintainers more familiar with it will take a look - I am afraid this might not be optimal way of doing it and possibly it can be done simpler.
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.
Thanks for the review and pointing this out. I have a similar feeling, but lack the context to come up with said simpler solution.
Would also appreciate any more opinions from others!
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.
@ashb @bolkedebruin - could either of you have a second glance at this PR?
|
@potiuk do you think we can go ahead with this? Or would you like me to chase after some more reviews? |
Context
The ability to clear newly introduced tasks in an already existing DAG run seems not to have been added to Airflow 3 yet.
The button in the UI is disabled at all times.
Implementation
In this PR I try to start with the basic requirement, which is to add functionality to the
dag.clear()function that ensures only newly added tasks are cleared.Questions to Reviewer
run_on_latest_version, but I am unsure of its purpose. I've seen it's experimental and I wonder if it is at all involved with the issue attached to this PR.Issue
See below the related issues.
related: #57051
related: #56250
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.