You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2023/08/30 08:53:31 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #33570: Fix waiting setup tasks when they are not a direct upstream

uranusjr commented on code in PR #33570:
URL: https://github.com/apache/airflow/pull/33570#discussion_r1309928233


##########
airflow/models/dag.py:
##########
@@ -717,6 +718,11 @@ def validate_setup_teardown(self):
         :meta private:
         """
         for task in self.tasks:
+            if task.is_setup:
+                for down_task in task.downstream_list:
+                    if not down_task.is_teardown and down_task.trigger_rule != TriggerRule.ALL_SUCCESS:
+                        # this is required to ensure consistent clearing behavior when upstream
+                        raise ValueError("Setup tasks must be followed with trigger rule ALL_SUCCESS.")

Review Comment:
   Since we’ve drilled this deep, can this show what the offending task is for clarity?



##########
airflow/models/dag.py:
##########
@@ -717,6 +718,11 @@ def validate_setup_teardown(self):
         :meta private:
         """
         for task in self.tasks:
+            if task.is_setup:
+                for down_task in task.downstream_list:
+                    if not down_task.is_teardown and down_task.trigger_rule != TriggerRule.ALL_SUCCESS:
+                        # this is required to ensure consistent clearing behavior when upstream
+                        raise ValueError("Setup tasks must be followed with trigger rule ALL_SUCCESS.")

Review Comment:
   Since we’ve drilled this deep, can this show what the offending task is for clarity?



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