Skip to content

Commit

Permalink
Rename --dag to --dag-id in backfill CLI command (#43478)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstandish authored Oct 29, 2024
1 parent e0fda35 commit 4fc16f1
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion airflow/cli/cli_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
6 changes: 3 additions & 3 deletions airflow/cli/commands/backfill_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,22 @@ 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,
reverse=args.run_backwards,
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,
Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow/core-concepts/backfill.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow/core-concepts/dag-run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow/start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/commands/test_backfill_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 4fc16f1

Please sign in to comment.