dkranchii opened a new pull request, #67363:
URL: https://github.com/apache/airflow/pull/67363
The `ui/dags.py` route file imported `HTTPException` from `http.client` (the
stdlib base class) instead of `fastapi`. FastAPI's exception handlers only
translate `fastapi.HTTPException`, so the 400-branch in `get_latest_run_info`
(when `dag_id == "~"`) escaped uncaught and the API returned **500 Internal
Server Error** instead of the intended **400 Bad Request** with the documented
detail message.
Fix is one line: drop `from http.client import HTTPException` and add
`HTTPException` to the existing `from fastapi import ...` line. Added a
regression test asserting `GET /dags/~/latest_run` returns 400 with the
expected detail body.
##### Was generative AI tooling used to co-author this PR?
- [X] Yes, (Cursor)
[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]