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/04/03 20:36:23 UTC
[GitHub] [airflow] uranusjr commented on a diff in pull request #29406: Add Fail Fast feature for DAGs
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org