Eason09053360 opened a new pull request, #73379: URL: https://github.com/apache/airflow/pull/73379
## Why `DAG.cli()`'s parser strips `dag_id`, but `action_cli` snapshots the namespace and writes the `Log` row before the handler runs. Audit rows for `python my_dag.py dags pause` and the five other `DAG.cli()` subcommands land with `dag_id` NULL not filterable by Dag, and under `core.multi_team` the `team_name` derived from it is lost too. The handlers' own back-fills run after that insert. ## What `DAG.cli()` now sets `args.dag_id` before dispatch. Every affected handler receives the Dag positionally and reads `args.dag_id` only behind a `dag or ...` short-circuit, so nothing but the audit row changes. The test goes through `tasks list`, the one affected handler that does not back-fill `dag_id` itself. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 5) Generated-by: Claude Code (Opus 5) 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]
