Skip to content

Commit

Permalink
refactor(trigger_rule): remove deprecated NONE_FAILED_OR_SKIPPED (apa…
Browse files Browse the repository at this point in the history
…che#44475)

* refactor(trigger_rule): remove deprecated NONE_FAILED_OR_SKIPPED

* docs(newsfragments): add 44475.significant.rst
  • Loading branch information
Lee-W authored Nov 30, 2024
1 parent 55e419e commit 348181b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
1 change: 0 additions & 1 deletion airflow/utils/trigger_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class TriggerRule(str, Enum):
ONE_FAILED = "one_failed"
ONE_DONE = "one_done"
NONE_FAILED = "none_failed"
NONE_FAILED_OR_SKIPPED = "none_failed_or_skipped"
NONE_SKIPPED = "none_skipped"
ALWAYS = "always"
NONE_FAILED_MIN_ONE_SUCCESS = "none_failed_min_one_success"
Expand Down
21 changes: 21 additions & 0 deletions newsfragments/44475.significant.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Remove ``TriggerRule.NONE_FAILED_OR_SKIPPED``

.. Provide additional contextual information
.. Check the type of change that applies to this change
* Types of change

* [x] DAG changes
* [ ] Config changes
* [ ] API changes
* [ ] CLI changes
* [ ] Behaviour changes
* [ ] Plugin changes
* [ ] Dependency change

.. List the migration rules needed for this change (see https://github.com/apache/airflow/issues/41641)
* Migrations rules needed

* Remove attribute ``TriggerRule.NONE_FAILED_OR_SKIPPED``
3 changes: 1 addition & 2 deletions tests/utils/test_trigger_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ def test_valid_trigger_rules(self):
assert TriggerRule.is_valid(TriggerRule.ONE_FAILED)
assert TriggerRule.is_valid(TriggerRule.ONE_DONE)
assert TriggerRule.is_valid(TriggerRule.NONE_FAILED)
assert TriggerRule.is_valid(TriggerRule.NONE_FAILED_OR_SKIPPED)
assert TriggerRule.is_valid(TriggerRule.NONE_SKIPPED)
assert TriggerRule.is_valid(TriggerRule.ALWAYS)
assert TriggerRule.is_valid(TriggerRule.NONE_FAILED_MIN_ONE_SUCCESS)
assert TriggerRule.is_valid(TriggerRule.ALL_DONE_SETUP_SUCCESS)
assert len(TriggerRule.all_triggers()) == 13
assert len(TriggerRule.all_triggers()) == 12

with pytest.raises(ValueError):
TriggerRule("NOT_EXIST_TRIGGER_RULE")

0 comments on commit 348181b

Please sign in to comment.