renzepost commented on code in PR #49752:
URL: https://github.com/apache/airflow/pull/49752#discussion_r2063945792


##########
airflow-core/src/airflow/api/common/mark_tasks.py:
##########
@@ -215,17 +215,35 @@ def set_dag_run_state_to_success(
     if not run_id:
         raise ValueError(f"Invalid dag_run_id: {run_id}")
 
-    # Mark all task instances of the dag run to success - except for teardown 
as they need to complete work.
+    # Mark all task instances of the dag run to success - except for running 
teardown as they need to complete work.
     normal_tasks = [task for task in dag.tasks if not task.is_teardown]
+    teardown_tasks = [task for task in dag.tasks if task.is_teardown]
+    running_states = (
+        TaskInstanceState.RUNNING,
+        TaskInstanceState.DEFERRED,
+        TaskInstanceState.UP_FOR_RESCHEDULE,
+    )

Review Comment:
   Wasn't aware of `State.unfinished`, agreed that's much better! Updated. Also 
changed the unit tests to cover the possible states.



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