You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/02 07:11:58 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #22699: add allow_manual DAG argument to prevent scheduled DAGs from being triggered manually

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



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

Review comment:
       Easier to use `self.timetable.periodic`




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