Eason09053360 opened a new pull request, #73424:
URL: https://github.com/apache/airflow/pull/73424

   ## Why
   
   `HTTPExceptionResponse.detail` is declared `str | dict`, but a trailing 
comma made two task-instance 404 messages one-element tuples, which FastAPI 
serializes as a JSON array. The UI's `ErrorAlert` then takes its 
`Array.isArray` branch — written for 422 validation errors, whose elements are 
`{loc, msg}` objects — and dereferences `.loc` on a plain string, so it throws 
while rendering and the 404 message never reaches the user.
   
   ## What
   
   - Dropped the trailing comma in `core_api/routes/public/task_instances.py` 
(`/dependencies`) and in the shared PATCH validator in 
`core_api/services/public/task_instances.py`, which covers all four PATCH 
task-instance endpoints.
   - The two existing `test_should_handle_errors` cases asserted the array form 
and were written from the buggy output; they now assert the string. 
`/dependencies` had no 404 test at all, so 
`TestGetTaskDependencies::test_should_respond_404` adds one for both route 
variants.
   
   ---
   
   ##### 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]

Reply via email to