Skip to content

Add ability to clear downstream tis in "List Task Instances" view #34529

Merged
hussein-awala merged 8 commits into
apache:mainfrom
peloyeje:feature/clear-with-downstream
Sep 22, 2023
Merged

Add ability to clear downstream tis in "List Task Instances" view #34529
hussein-awala merged 8 commits into
apache:mainfrom
peloyeje:feature/clear-with-downstream

Conversation

@peloyeje

@peloyeje peloyeje commented Sep 21, 2023

Copy link
Copy Markdown
Contributor

Adds a new "clear (including downstream)" action in the "List Task Instances" view
Also a bit of refactoring so that "clear" / "clear including downstream" share the same logic
Added a unit test to make sure clearing logic is "run-aware"

closes: #33014


^ 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.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg Bot added area:webserver Webserver related Issues kind:documentation labels Sep 21, 2023
@hussein-awala hussein-awala self-requested a review September 21, 2023 17:54
@hussein-awala hussein-awala added the type:new-feature Changelog: New Features label Sep 21, 2023
@hussein-awala hussein-awala added this to the Airflow 2.8.0 milestone Sep 21, 2023
@peloyeje peloyeje marked this pull request as ready for review September 21, 2023 19:10
Comment thread airflow/www/views.py Outdated

@hussein-awala hussein-awala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Comment thread airflow/www/views.py Outdated
@peloyeje peloyeje force-pushed the feature/clear-with-downstream branch 2 times, most recently from 3977962 to 4ad02d1 Compare September 22, 2023 00:52

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, looking nice

Comment thread tests/www/views/test_views_tasks.py Outdated
Comment thread airflow/www/views.py Outdated
@peloyeje peloyeje force-pushed the feature/clear-with-downstream branch from ca8cfaa to 9e5a466 Compare September 22, 2023 16:53
@peloyeje

peloyeje commented Sep 22, 2023

Copy link
Copy Markdown
Contributor Author

Just pushed yet another tweaks to the initial implementation so that models.clear_task_instances is called only once per DAG and batches DAG run operations; sorry for all these iterations, but I've run out of ideas now 😄

@hussein-awala hussein-awala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! LGTM

Comment thread airflow/www/views.py Outdated
Comment thread airflow/www/views.py
task_id for task_id in partial_dag.task_dict if task_id not in task_ids_to_clear
]

# dag.clear returns TIs when in dry run mode

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

@hussein-awala hussein-awala merged commit 5b0ce3d into apache:main Sep 22, 2023
@boring-cyborg

boring-cyborg Bot commented Sep 22, 2023

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@hussein-awala

Copy link
Copy Markdown
Member

Congrats Jean-Eudes on your first commit 🎉

@peloyeje

Copy link
Copy Markdown
Contributor Author

Thanks everyone for your feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webserver Webserver related Issues kind:documentation type:new-feature Changelog: New Features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clearing task from List Task Instance page in UI does not also clear downstream tasks?

4 participants