Skip to content

Conversation

@abhishekbhakat
Copy link
Contributor

closes: #43475

There no reason to leave any task as None state when marking the dag_run as failed manually.

@boring-cyborg boring-cyborg bot added the area:API Airflow's REST/HTTP API label Oct 29, 2024
Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

Looks good. Could you add a unit test for this though please?

@ashb ashb added this to the Airflow 2.10.3 milestone Oct 29, 2024
@abhishekbhakat
Copy link
Contributor Author

Looks good. Could you add a unit test for this though please?

Done. Added a test which will fail without the code changes like:

=============================================================================== short test summary info ================================================================================
FAILED tests/www/views/test_views_dagrun.py::test_dagrun_failed - AssertionError: assert None in {'failed', 'skipped', 'success', 'upstream_failed'}
 +  where None = <TaskInstance: example_bash_decorator.run_this_last test_dagrun_failed [None]>.state
============================================================================= 1 failed, 1 warning in 6.21s =============================================================================
root@b8d8405b20f5:/opt/airflow# python -m pytest -vvv tests/www/views/test_views_dagrun.py::test_dagrun_failed
================================================================================= test session starts ==================================================================================

@ashb ashb merged commit eda6a8f into apache:main Oct 29, 2024
@potiuk potiuk modified the milestones: Airflow 2.11.0, Airflow 2.10.3 Oct 31, 2024
utkarsharma2 pushed a commit to astronomer/airflow that referenced this pull request Nov 1, 2024
@utkarsharma2
Copy link
Contributor

Backported to v2-10-test in PR - #43572

utkarsharma2 added a commit that referenced this pull request Nov 1, 2024
#43572)

* Mark all tasks as skipped when failing a dag_run manually including tasks with None state (#43482)

(cherry picked from commit eda6a8f)

* Fix tests for 2.10.x

---------

Co-authored-by: Abhishek <abhishek.bhakat@hotmail.com>
@utkarsharma2 utkarsharma2 added the type:bug-fix Changelog: Bug Fixes label Nov 1, 2024
utkarsharma2 added a commit that referenced this pull request Nov 1, 2024
#43572)

* Mark all tasks as skipped when failing a dag_run manually including tasks with None state (#43482)

(cherry picked from commit eda6a8f)

* Fix tests for 2.10.x

---------

Co-authored-by: Abhishek <abhishek.bhakat@hotmail.com>
(cherry picked from commit 72eef0f)
utkarsharma2 added a commit that referenced this pull request Nov 1, 2024
#43572)

* Mark all tasks as skipped when failing a dag_run manually including tasks with None state (#43482)

(cherry picked from commit eda6a8f)

* Fix tests for 2.10.x

---------

Co-authored-by: Abhishek <abhishek.bhakat@hotmail.com>
(cherry picked from commit 72eef0f)
utkarsharma2 added a commit that referenced this pull request Nov 1, 2024
#43572)

* Mark all tasks as skipped when failing a dag_run manually including tasks with None state (#43482)

(cherry picked from commit eda6a8f)

* Fix tests for 2.10.x

---------

Co-authored-by: Abhishek <abhishek.bhakat@hotmail.com>
(cherry picked from commit 72eef0f)
utkarsharma2 added a commit that referenced this pull request Nov 1, 2024
#43572)

* Mark all tasks as skipped when failing a dag_run manually including tasks with None state (#43482)

(cherry picked from commit eda6a8f)

* Fix tests for 2.10.x

---------

Co-authored-by: Abhishek <abhishek.bhakat@hotmail.com>
(cherry picked from commit 72eef0f)
ellisms pushed a commit to ellisms/airflow that referenced this pull request Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trigger Rule all_done does not honor the dag_run marked failed manually and brings back the dag_run to running.

5 participants