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

dstandish 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 4fc16f154d Rename --dag to --dag-id in backfill CLI command (#43478)
4fc16f154d is described below

commit 4fc16f154d2a159dd52955b40d5ef440d3d82425
Author: Daniel Standish <[email protected]>
AuthorDate: Tue Oct 29 15:11:23 2024 -0700

    Rename --dag to --dag-id in backfill CLI command (#43478)
---
 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 1507dcf713..15543023cb 100644
--- a/airflow/cli/cli_config.py
+++ b/airflow/cli/cli_config.py
@@ -304,7 +304,7 @@ ARG_POOL = Arg(("--pool",), "Resource pool to use")
 
 
 # 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 4e31e04e59..63a8573ab7 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 db70279fd2..ac6729b23d 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 85411bc964..6c313cc324 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 4482e00d79..df263263f1 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 bfa602450f..52e1604fd1 100644
--- a/tests/cli/commands/test_backfill_command.py
+++ b/tests/cli/commands/test_backfill_command.py
@@ -77,7 +77,7 @@ class TestCliBackfill:
         args = [
             "backfill",
             "create",
-            "--dag",
+            "--dag-id",
             "example_bash_operator",
             "--from-date",
             DEFAULT_DATE.isoformat(),

Reply via email to