dstandish commented on code in PR #31676:
URL: https://github.com/apache/airflow/pull/31676#discussion_r1214051151


##########
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:
   Yeah it's an odd case. Very much nonsensical edge case that doesn't really 
make sense. If there's no non teardown tasks then there's no point in ignoring 
the teardowns. There's no point in even having tasks marked as teardowns in 
that case. So this seemed like a sensible fallback but we can discuss



-- 
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]

Reply via email to