Skip to content

[v3-3-test] Fix clearTaskInstances returning 500 instead of 422 on invalid body (#70237) - #71559

Merged
pierrejeambrun merged 1 commit into
v3-3-testfrom
backport-efec6ba-v3-3-test
Aug 14, 2026
Merged

pierrejeambrun merged 1 commit into
v3-3-testfrom
backport-efec6ba-v3-3-test

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

The ClearTaskInstancesBody validator raised pydantic.ValidationError with a
string argument for its invalid-input branches. In Pydantic v2 that constructor
call raises TypeError, which the core API has no handler for, so an invalid
request body surfaced as 500 Internal Server Error instead of a 422. Raising
ValueError lets Pydantic report the problem as a normal 422, matching the
sibling PatchTaskInstanceBody validator in the same file.
(cherry picked from commit efec6ba)

Co-authored-by: SreeramaYeshwanthGowd [email protected]

…invalid body (#70237)

The ClearTaskInstancesBody validator raised pydantic.ValidationError with a
string argument for its invalid-input branches. In Pydantic v2 that constructor
call raises TypeError, which the core API has no handler for, so an invalid
request body surfaced as 500 Internal Server Error instead of a 422. Raising
ValueError lets Pydantic report the problem as a normal 422, matching the
sibling PatchTaskInstanceBody validator in the same file.
(cherry picked from commit efec6ba)

Co-authored-by: SreeramaYeshwanthGowd <[email protected]>

@uros-b uros-b left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this good to go?

@pierrejeambrun
pierrejeambrun merged commit 600c8f7 into v3-3-test Aug 14, 2026
135 checks passed
@pierrejeambrun
pierrejeambrun deleted the backport-efec6ba-v3-3-test branch August 14, 2026 12:51
@github-actions github-actions Bot added this to the Airflow 3.3.2 milestone Aug 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

Hi maintainer, this PR was merged without a milestone set.
We've automatically set the milestone to Airflow 3.3.2 based on: bug fix merged to version branch
If this milestone is not correct, please update it to the appropriate milestone.

This comment was generated by Milestone Tag Assistant.

vatsrahul1001 pushed a commit that referenced this pull request Sep 7, 2026
…invalid body (#70237) (#71559)

The ClearTaskInstancesBody validator raised pydantic.ValidationError with a
string argument for its invalid-input branches. In Pydantic v2 that constructor
call raises TypeError, which the core API has no handler for, so an invalid
request body surfaced as 500 Internal Server Error instead of a 422. Raising
ValueError lets Pydantic report the problem as a normal 422, matching the
sibling PatchTaskInstanceBody validator in the same file.
(cherry picked from commit efec6ba)

Co-authored-by: SreeramaYeshwanthGowd <[email protected]>
@vatsrahul1001 vatsrahul1001 added the type:bug-fix Changelog: Bug Fixes label Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants