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

   `POST /dags/{dag_id}/clearTaskInstances` returns `500` instead of `422` when 
the request body is invalid. The `ClearTaskInstancesBody` validator raised 
`pydantic.ValidationError("...")`, which in Pydantic v2 is a `TypeError`, and 
the API has no handler for it, so a bad request surfaces as a server error.
   
   Raising `ValueError` lets Pydantic report it as a `422`, matching the 
sibling `PatchTaskInstanceBody` validator in the same file. Added a 
parametrized test covering each invalid body case.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code (Opus 4.8) 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