uranusjr commented on code in PR #22699: URL: https://github.com/apache/airflow/pull/22699#discussion_r845733347
########## airflow/models/dag.py: ########## @@ -2280,6 +2284,12 @@ def create_dagrun( "Creating DagRun needs either `run_id` or both `run_type` and `execution_date`" ) + if not self.allow_manual and run_type == DagRunType.MANUAL: + raise AirflowException( + f"Cannot manually trigger DAG {self.dag_id}, because 'allow_manual' is " + f"set to {self.allow_manual}" + ) Review Comment: Use a dedicated exception subclass here. You will need to catch this in a lot of places, and using `AirflowException` directly will make things very difficult. -- 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-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org