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


##########
airflow/models/baseoperator.py:
##########
@@ -767,6 +767,9 @@ def __init__(
         dag = dag or DagContext.get_current_dag()
         task_group = task_group or TaskGroupContext.get_current_task_group(dag)
 
+        if dag is not None and dag.fail_stop and trigger_rule != 
DEFAULT_TRIGGER_RULE:
+            raise DagInvalidTriggerRule()

Review Comment:
   It seems awkward to me `fail_stop` and `DEFAULT_TRIGGER_RULE` are repeated 
when we check to raise the exception, and when the exception is rendered.
   
   Would something like a `check` function on `DagInvalidTriggerRule` 
encapsulating the logic be a good idea, so the logic exists only in one class?



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