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


##########
airflow/models/dag.py:
##########
@@ -615,6 +618,16 @@ def __init__(
         self.last_loaded: datetime = timezone.utcnow()
         self.safe_dag_id = dag_id.replace(".", "__dot__")
         self.max_active_runs = max_active_runs
+        self.max_consecutive_failed_dag_runs = max_consecutive_failed_dag_runs
+        if self.max_consecutive_failed_dag_runs is None:
+            self.max_consecutive_failed_dag_runs = airflow_conf.getint(
+                "core", "max_consecutive_failed_dag_runs_per_dag"
+            )
+        if self.max_consecutive_failed_dag_runs < 0:
+            raise AirflowException(
+                f"Invalid max_consecutive_failed_dag_runs: 
{str(self.max_consecutive_failed_dag_runs)}."

Review Comment:
   ```suggestion
                   f"Invalid max_consecutive_failed_dag_runs: 
{self.max_consecutive_failed_dag_runs}."
   ```



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