You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/12/29 18:51:56 UTC

[GitHub] [airflow] dstandish commented on a diff in pull request #26993: Fix ti._try_number for deferred and up_for_reschedule tasks

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


##########
airflow/utils/state.py:
##########
@@ -137,6 +137,20 @@ def color_fg(cls, state):
             return "white"
         return "black"
 
+    waiting: frozenset[TaskInstanceState] = frozenset(
+        [TaskInstanceState.DEFERRED, TaskInstanceState.UP_FOR_RESCHEDULE]
+    )
+    """
+    A list of states indicating that a task is sensing or deferred
+    """
+
+    pending: frozenset[TaskInstanceState] = frozenset(
+        [TaskInstanceState.RUNNING, TaskInstanceState.DEFERRED, TaskInstanceState.UP_FOR_RESCHEDULE]
+    )
+    """
+    Running tasks + sensing tasks (task reschedules makes up_for_reschedule act a little differently)
+    """
+

Review Comment:
   I think it's best not to add these.  I've seen recently how these types of labels can mean different things in different contexts.  E.g. we have `DEFERRED` as part of the `running` list, and that results in the wrong try number when logging from trigger.  I think when in doubt just reference the states explicitly.



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