ephraimbuddy commented on a change in pull request #22699:
URL: https://github.com/apache/airflow/pull/22699#discussion_r841021374



##########
File path: airflow/models/dag.py
##########
@@ -2347,6 +2352,19 @@ def create_dagrun(
             creating_job_id=creating_job_id,
             data_interval=data_interval,
         )
+
+        # prevent triggering manually for scheduled DAGs, while 'allow_manual' 
= False
+        if (
+            run.run_type == DagRunType.MANUAL
+            and self.schedule_interval is not None
+            and self.schedule_interval != "@once"
+            and not self.allow_manual
+        ):
+            raise AirflowException(
+                f"Cannot manually trigger DAG {self.dag_id}, because it is a 
scheduled DAG, "
+                f"and 'allow_manual' is set to {self.allow_manual}"

Review comment:
       Can we add a unittest so that this is not accidentally removed in the 
future 




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