Eason09053360 opened a new pull request, #73387:
URL: https://github.com/apache/airflow/pull/73387
## Why
`DAG.cli()` passes its own Dag object to the handler, which short-circuits
on it and never looks a
Dag up — so `-B/--bundle-name` and `-f/--dagfile-path` were listed in
`--help` and parsed fine, but
nothing ever read them. `python my_dag.py tasks list -B does_not_exist`
exits 0 listing the local
Dag's tasks, and `python my_dag.py dags test -f /elsewhere/other.py` reports
success for a Dag it
never touched.
## What
- `airflow-core/src/airflow/cli/cli_config.py`: `_remove_dag_id_opt` (renamed
`_remove_dag_selection_opts`) now strips `ARG_BUNDLE_NAME` and
`ARG_DAGFILE_PATH` alongside
`ARG_DAG_ID`, so the per-Dag parser rejects them. The full `airflow` CLI
is unchanged.
- `airflow-core/tests/unit/cli/test_cli_parser.py`: parametrized test over
`dags test` and
`tasks list`/`tasks test`; all four cases pass on the parser today.
- Deliberately untouched: `--treat-dag-id-as-regex`, which `set_is_paused`
does read, and the long
`--help` descriptions, which have shown full-CLI examples naming the
removed `--dag-id` since
2021.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Opus 5 (Claude Code)
Generated-by: Claude Opus 5 (Claude Code) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]