This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new ed6ea72f18 Fix command dags list-runs argument dag_id (#25978)
ed6ea72f18 is described below

commit ed6ea72f181a1d381cc1ff6c801f10cc0bc0d830
Author: Chenglong Yan <[email protected]>
AuthorDate: Sat Aug 27 10:20:02 2022 +0800

    Fix command dags list-runs argument dag_id (#25978)
    
    dag_id should be a positional argument.
---
 airflow/cli/cli_parser.py              | 4 ++--
 tests/cli/commands/test_dag_command.py | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/airflow/cli/cli_parser.py b/airflow/cli/cli_parser.py
index 72f2efec0d..20b55d56a3 100644
--- a/airflow/cli/cli_parser.py
+++ b/airflow/cli/cli_parser.py
@@ -254,13 +254,13 @@ ARG_REVISION_RANGE = Arg(
 )
 
 # list_dag_runs
-ARG_DAG_ID_OPT = Arg(("-d", "--dag-id"), help="The id of the dag")
 ARG_NO_BACKFILL = Arg(
     ("--no-backfill",), help="filter all the backfill dagruns given the dag 
id", action="store_true"
 )
 ARG_STATE = Arg(("--state",), help="Only list the dag runs corresponding to 
the state")
 
 # list_jobs
+ARG_DAG_ID_OPT = Arg(("-d", "--dag-id"), help="The id of the dag")
 ARG_LIMIT = Arg(("--limit",), help="Return a limited number of records")
 
 # next_execution
@@ -999,7 +999,7 @@ DAGS_COMMANDS = (
         ),
         
func=lazy_load_command('airflow.cli.commands.dag_command.dag_list_dag_runs'),
         args=(
-            ARG_DAG_ID_OPT,
+            ARG_DAG_ID,
             ARG_NO_BACKFILL,
             ARG_STATE,
             ARG_OUTPUT,
diff --git a/tests/cli/commands/test_dag_command.py 
b/tests/cli/commands/test_dag_command.py
index 3544769ff0..f6c85468a5 100644
--- a/tests/cli/commands/test_dag_command.py
+++ b/tests/cli/commands/test_dag_command.py
@@ -471,13 +471,12 @@ class TestCliDags(unittest.TestCase):
             [
                 'dags',
                 'list-runs',
-                '--dag-id',
-                'example_bash_operator',
                 '--no-backfill',
                 '--start-date',
                 DEFAULT_DATE.isoformat(),
                 '--end-date',
                 timezone.make_aware(datetime.max).isoformat(),
+                'example_bash_operator',
             ]
         )
         dag_command.dag_list_dag_runs(args)

Reply via email to