dstandish commented on code in PR #31658:
URL: https://github.com/apache/airflow/pull/31658#discussion_r1213594403
##########
airflow/models/dagrun.py:
##########
@@ -533,6 +533,25 @@ def get_previous_scheduled_dagrun(self, session: Session =
NEW_SESSION) -> DagRu
.first()
)
+ def _tis_for_dagrun_state(self, *, dag, tis):
+ """
+ Return the collection of tasks that should be considered for
evaluation of terminal dag run state.
+
+ Teardown tasks by default are not considered for the purpose of dag
run state. But
+ users may enable such consideration with on_failure_fail_dagrun.
+ """
+ leaf_task_ids = {t.task_id for t in dag.leaves}
+ leaf_tis = {ti for ti in tis if ti.task_id in leaf_task_ids if
ti.state != TaskInstanceState.REMOVED}
+ if dag.teardowns:
Review Comment:
I explored this but doing so adds an extra return statement which is not
needed if we do it this way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]