Skip to content

Commit ed6ea72

Browse files
authored
Fix command dags list-runs argument dag_id (#25978)
dag_id should be a positional argument.
1 parent dbfa648 commit ed6ea72

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

airflow/cli/cli_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,13 @@ def string_lower_type(val):
254254
)
255255

256256
# list_dag_runs
257-
ARG_DAG_ID_OPT = Arg(("-d", "--dag-id"), help="The id of the dag")
258257
ARG_NO_BACKFILL = Arg(
259258
("--no-backfill",), help="filter all the backfill dagruns given the dag id", action="store_true"
260259
)
261260
ARG_STATE = Arg(("--state",), help="Only list the dag runs corresponding to the state")
262261

263262
# list_jobs
263+
ARG_DAG_ID_OPT = Arg(("-d", "--dag-id"), help="The id of the dag")
264264
ARG_LIMIT = Arg(("--limit",), help="Return a limited number of records")
265265

266266
# next_execution
@@ -999,7 +999,7 @@ class GroupCommand(NamedTuple):
999999
),
10001000
func=lazy_load_command('airflow.cli.commands.dag_command.dag_list_dag_runs'),
10011001
args=(
1002-
ARG_DAG_ID_OPT,
1002+
ARG_DAG_ID,
10031003
ARG_NO_BACKFILL,
10041004
ARG_STATE,
10051005
ARG_OUTPUT,

tests/cli/commands/test_dag_command.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,13 +471,12 @@ def test_cli_list_dag_runs(self):
471471
[
472472
'dags',
473473
'list-runs',
474-
'--dag-id',
475-
'example_bash_operator',
476474
'--no-backfill',
477475
'--start-date',
478476
DEFAULT_DATE.isoformat(),
479477
'--end-date',
480478
timezone.make_aware(datetime.max).isoformat(),
479+
'example_bash_operator',
481480
]
482481
)
483482
dag_command.dag_list_dag_runs(args)

0 commit comments

Comments
 (0)