From dee1d64fc94c8fff881c0eee1718cba4ffb032b3 Mon Sep 17 00:00:00 2001 From: Daniel Standish <15932138+dstandish@users.noreply.github.com> Date: Tue, 29 Oct 2024 07:18:16 -0700 Subject: [PATCH] Rename --dag to --dag-id in backfill CLI command --- airflow/cli/cli_config.py | 2 +- airflow/cli/commands/backfill_command.py | 6 +++--- docs/apache-airflow/core-concepts/backfill.rst | 2 +- docs/apache-airflow/core-concepts/dag-run.rst | 2 +- docs/apache-airflow/start.rst | 2 +- tests/cli/commands/test_backfill_command.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/airflow/cli/cli_config.py b/airflow/cli/cli_config.py index 1507dcf7132dd..15543023cbf67 100644 --- a/airflow/cli/cli_config.py +++ b/airflow/cli/cli_config.py @@ -304,7 +304,7 @@ def string_lower_type(val): # backfill -ARG_BACKFILL_DAG = Arg(flags=("--dag",), help="The dag to backfill.", required=True) +ARG_BACKFILL_DAG = Arg(flags=("--dag-id",), help="The dag to backfill.", required=True) ARG_BACKFILL_FROM_DATE = Arg( ("--from-date",), help="Earliest logical date to backfill.", type=parsedate, required=True ) diff --git a/airflow/cli/commands/backfill_command.py b/airflow/cli/commands/backfill_command.py index 4e31e04e590aa..63a8573ab7379 100644 --- a/airflow/cli/commands/backfill_command.py +++ b/airflow/cli/commands/backfill_command.py @@ -63,7 +63,7 @@ def create_backfill(args) -> None: if args.dry_run: _do_dry_run( params=dict( - dag_id=args.dag, + dag_id=args.dag_id, from_date=args.from_date, to_date=args.to_date, max_active_runs=args.max_active_runs, @@ -71,14 +71,14 @@ def create_backfill(args) -> None: dag_run_conf=args.dag_run_conf, reprocess_behavior=reprocess_behavior, ), - dag_id=args.dag, + dag_id=args.dag_id, from_date=args.from_date, to_date=args.to_date, reverse=args.run_backwards, ) return _create_backfill( - dag_id=args.dag, + dag_id=args.dag_id, from_date=args.from_date, to_date=args.to_date, max_active_runs=args.max_active_runs, diff --git a/docs/apache-airflow/core-concepts/backfill.rst b/docs/apache-airflow/core-concepts/backfill.rst index db70279fd272a..ac6729b23d0d7 100644 --- a/docs/apache-airflow/core-concepts/backfill.rst +++ b/docs/apache-airflow/core-concepts/backfill.rst @@ -60,7 +60,7 @@ Example: .. code-block:: bash - airflow backfill create --dag tutorial \ + airflow backfill create --dag-id tutorial \ --start-date 2015-06-01 \ --end-date 2015-06-07 \ --reprocessing-behavior failed \ diff --git a/docs/apache-airflow/core-concepts/dag-run.rst b/docs/apache-airflow/core-concepts/dag-run.rst index 85411bc964214..6c313cc3248ce 100644 --- a/docs/apache-airflow/core-concepts/dag-run.rst +++ b/docs/apache-airflow/core-concepts/dag-run.rst @@ -153,7 +153,7 @@ This can be done through API or CLI. For CLI usage, run the command below: .. code-block:: bash - airflow backfill create --dag DAG_ID \ + airflow backfill create --dag-id DAG_ID \ --start-date START_DATE \ --end-date END_DATE \ diff --git a/docs/apache-airflow/start.rst b/docs/apache-airflow/start.rst index 4482e00d7987b..df263263f1cb1 100644 --- a/docs/apache-airflow/start.rst +++ b/docs/apache-airflow/start.rst @@ -110,7 +110,7 @@ run the commands below. # run your first task instance airflow tasks test example_bash_operator runme_0 2015-01-01 # run a backfill over 2 days - airflow backfill create --dag example_bash_operator \ + airflow backfill create --dag-id example_bash_operator \ --start-date 2015-01-01 \ --end-date 2015-01-02 diff --git a/tests/cli/commands/test_backfill_command.py b/tests/cli/commands/test_backfill_command.py index bfa602450fc33..52e1604fd1797 100644 --- a/tests/cli/commands/test_backfill_command.py +++ b/tests/cli/commands/test_backfill_command.py @@ -77,7 +77,7 @@ def test_backfill(self, mock_create, repro, expected_repro): args = [ "backfill", "create", - "--dag", + "--dag-id", "example_bash_operator", "--from-date", DEFAULT_DATE.isoformat(),