shahar1 commented on code in PR #38265:
URL: https://github.com/apache/airflow/pull/38265#discussion_r1529768511
##########
airflow/cli/commands/dag_command.py:
##########
@@ -214,14 +215,37 @@ def dag_unpause(args) -> None:
@providers_configuration_loaded
def set_is_paused(is_paused: bool, args) -> None:
"""Set is_paused for DAG by a given dag_id."""
- dag = DagModel.get_dagmodel(args.dag_id)
-
- if not dag:
- raise SystemExit(f"DAG: {args.dag_id} does not exist in 'dag' table")
+ should_apply = True
+ dags = [
+ dag
+ for dag in get_dags(args.subdir, dag_id=args.dag_id,
use_regex=args.treat_dag_as_regex)
Review Comment:
`--treat-dag-as-regex` is a flag that indicates that `dag_id` should be
treated as a regex.
If we consolidate them into one arg (meaning that `dag_id` is always a
regex), then `dag_id="dag"` could match `dag`, but also `dag-1`, `dag-2`,
`dag-3`, etc., and it will become an unnecessary breaking change.
--
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]