You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hussein-awala (via GitHub)" <gi...@apache.org> on 2023/06/02 07:13:34 UTC

[GitHub] [airflow] hussein-awala commented on a diff in pull request #31676: Correct dagrun state logic when dag is all teardowns

hussein-awala commented on code in PR #31676:
URL: https://github.com/apache/airflow/pull/31676#discussion_r1214008734


##########
airflow/models/dagrun.py:
##########
@@ -552,6 +552,9 @@ def is_effective_leaf(task):
             return not task.is_teardown or task.on_failure_fail_dagrun
 
         leaf_task_ids = {x.task_id for x in dag.tasks if is_effective_leaf(x)}
+        if not leaf_task_ids:
+            # can happen if dag is exclusively teardown tasks
+            leaf_task_ids = {x.task_id for x in dag.tasks if not x.downstream_list}

Review Comment:
   Why do we need a non-empty list of leaves? Does it affect the DAG run state or serve a different purpose?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org