Zi-Yi-Ming opened a new pull request, #77717:
URL: https://github.com/apache/airflow/pull/77717

   Allow `airflow dags list-import-errors` to check a specific local Dag file 
or directory. A file selects just that file. A directory limits discovery to 
that directory. `--dag-path` selects local parsing by itself. Choose either 
`--dag-path` or `--bundle-name`.
   
   ```bash
   airflow dags list-import-errors --dag-path ./dags/reporting.py --output json
   airflow dags list-import-errors --dag-path ./dags/reporting --output json
   ```
   
   On `main`, `--local` scans the configured Dag directory when no bundle is 
selected. In a fresh SQLite environment, it reports that the database needs 
migration. Both local modes retain the existing database initialization 
requirement.
   
   related: #57306
   
   ### Local verification
   
   - Reproduced the existing behavior on `main` at `5ce3771`. Before migration, 
`--local` exited with a migration error. After migration it reported both 
broken Dag files in the configured directory. The baseline CLI rejected 
`--dag-path`.
   - Ran the updated CLI against the same fixture. The file and directory 
selections reported only errors within the selected path. A healthy file 
returned `[]` with exit code 0. A missing path and a path combined with 
`--bundle-name` were rejected. The existing `--local` scan and default 
database-backed output were also exercised.
   - Ran `pytest airflow-core/tests/unit/cli/commands/test_dag_command.py -k 
list_import_errors` through the workspace's `uv` environment on Linux with 
Python 3.12 and SQLite. All 7 targeted tests passed.
   - Ran the full `test_dag_command.py` file in the same environment. All 134 
tests passed.
   - Ruff, `git diff --check`, and the repository's applicable `prek` checks 
passed, including airflow-core mypy.
   - Ran the three checks selected by `breeze verify`. The Always and CLI 
groups passed with SQLite and without a database. Both Apache Airflow and Task 
SDK documentation builds passed. The docs build used a local derivative of the 
official CI image with Chromium and Mermaid CLI preinstalled after APT download 
failures.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — OpenAI Codex (GPT-6)
   
   Generated-by: OpenAI Codex (GPT-6) 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]

Reply via email to