utkarsharma2 commented on code in PR #32041:
URL: https://github.com/apache/airflow/pull/32041#discussion_r1237230442
##########
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")
Review Comment:
Maybe we should a test for missing dag as well.
##########
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")
Review Comment:
Maybe we should test for missing dag as well.
--
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]