You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "pankajastro (via GitHub)" <gi...@apache.org> on 2023/06/21 15:40:07 UTC

[GitHub] [airflow] pankajastro commented on a diff in pull request #32041: Raise error in dag trigger for paused dag

pankajastro commented on code in PR #32041:
URL: https://github.com/apache/airflow/pull/32041#discussion_r1237215659


##########
airflow/cli/commands/dag_command.py:
##########
@@ -145,6 +145,11 @@ def dag_backfill(args, dag: list[DAG] | DAG | None = None) -> None:
 @cli_utils.action_cli
 def dag_trigger(args) -> None:
     """Creates a dag run for the specified dag."""
+    dag = DagModel.get_dagmodel(args.dag_id)
+    if not dag:
+        raise SystemExit(f"DAG: {args.dag_id} does not exist in 'dag' table")
+    if dag.is_paused:
+        raise AirflowException(f"DAG with dag_id: {args.dag_id} is paused.")

Review Comment:
   it shouldn't. thank you for pointing out.



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