jason810496 opened a new pull request, #67367: URL: https://github.com/apache/airflow/pull/67367
- related: https://github.com/apache/airflow/pull/67363 ## Why `fastapi.HTTPException`, `starlette.exceptions.HTTPException`, and `http.client.HTTPException` are three different classes — mixing them silently breaks `isinstance` / `pytest.raises` checks, and `http.client.HTTPException` has a different constructor so routes return 500 instead of the intended status (the exact bug #67363 fixed in `core_api/routes/ui/dags.py`). ## What - Add `scripts/ci/prek/check_http_exception_import_from_fastapi.py` — an AST-based prek hook that flags any `from <module> import HTTPException` where `<module>` is not `fastapi` (or a `fastapi.*` submodule). - Register it in `.pre-commit-config.yaml`, scoped to the FastAPI-using trees: `airflow-core/src/airflow/api_fastapi/`, `airflow-core/tests/unit/api_fastapi/`, and the `src/` + `tests/` of the providers that wire FastAPI apps (`amazon`, `common/ai`, `edge3`, `fab`, `keycloak`). --- ##### Was generative AI tooling used to co-author this PR? - [x] Yes, with help of Claude Code Opus 4.7 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]
