From ab5235ee1232bb60b180dfd5f10c980d66cb75d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Bregu=C5=82a?= Date: Fri, 4 Sep 2020 01:25:39 +0200 Subject: [PATCH] Unify command names in CLI (#10720) * Unify command names in CLI * fixup! Unify command names in CLI --- UPDATING.md | 1 + airflow/cli/cli_parser.py | 2 +- airflow/cli/commands/dag_command.py | 2 +- tests/cli/commands/test_dag_command.py | 6 +++--- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/UPDATING.md b/UPDATING.md index c15ae8eb0d..10409faa00 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -235,6 +235,7 @@ you have to run the help command: ``airflow celery --help``. | ``airflow list_dag_runs`` | ``airflow dags list-runs`` | ``dags`` | | ``airflow pause`` | ``airflow dags pause`` | ``dags`` | | ``airflow unpause`` | ``airflow dags unpause`` | ``dags`` | +| ``airflow next_execution`` | ``airflow dags next-execution`` | ``dags`` | | ``airflow test`` | ``airflow tasks test`` | ``tasks`` | | ``airflow clear`` | ``airflow tasks clear`` | ``tasks`` | | ``airflow list_tasks`` | ``airflow tasks list`` | ``tasks`` | diff --git a/airflow/cli/cli_parser.py b/airflow/cli/cli_parser.py index 1b37345e44..550c0eca5e 100644 --- a/airflow/cli/cli_parser.py +++ b/airflow/cli/cli_parser.py @@ -810,7 +810,7 @@ DAGS_COMMANDS = ( args=(ARG_DAG_ID, ARG_EXECUTION_DATE, ARG_SUBDIR), ), ActionCommand( - name='next_execution', + name='next-execution', help="Get the next execution datetimes of a DAG", description=( "Get the next execution datetimes of a DAG. It returns one execution unless the " diff --git a/airflow/cli/commands/dag_command.py b/airflow/cli/commands/dag_command.py index 13dd351edc..246a74db85 100644 --- a/airflow/cli/commands/dag_command.py +++ b/airflow/cli/commands/dag_command.py @@ -271,7 +271,7 @@ def dag_state(args): def dag_next_execution(args): """ Returns the next execution datetime of a DAG at the command line. - >>> airflow dags next_execution tutorial + >>> airflow dags next-execution tutorial 2018-08-31 10:38:00 """ dag = get_dag(args.subdir, args.dag_id) diff --git a/tests/cli/commands/test_dag_command.py b/tests/cli/commands/test_dag_command.py index 46711b3253..b1b2b13df1 100644 --- a/tests/cli/commands/test_dag_command.py +++ b/tests/cli/commands/test_dag_command.py @@ -257,7 +257,7 @@ class TestCliDags(unittest.TestCase): # Test None output args = self.parser.parse_args(['dags', - 'next_execution', + 'next-execution', dag_ids[0]]) with contextlib.redirect_stdout(io.StringIO()) as temp_stdout: dag_command.dag_next_execution(args) @@ -289,7 +289,7 @@ class TestCliDags(unittest.TestCase): # Test num-executions = 1 (default) args = self.parser.parse_args(['dags', - 'next_execution', + 'next-execution', dag_id]) with contextlib.redirect_stdout(io.StringIO()) as temp_stdout: dag_command.dag_next_execution(args) @@ -298,7 +298,7 @@ class TestCliDags(unittest.TestCase): # Test num-executions = 2 args = self.parser.parse_args(['dags', - 'next_execution', + 'next-execution', dag_id, '--num-executions', '2'])