Skip to content

Serialize purgeRequested as a lowercase boolean in REST drop_table - #4341

Merged
kevinjqliu merged 2 commits into
apache:mainfrom
Anurag-S1ngh:fix/3836-rest-drop-table-purge-requested
Nov 11, 2026
Merged

kevinjqliu merged 2 commits into
apache:mainfrom
Anurag-S1ngh:fix/3836-rest-drop-table-purge-requested

Conversation

@Anurag-S1ngh

Copy link
Copy Markdown
Contributor

Closes #3836

Rationale for this change

RestCatalog.drop_table passed the purge_requested boolean directly into the requests query params, and requests serializes True as "True". The REST catalog spec defines purgeRequested as a boolean query parameter, so spec-compliant servers reject the capitalized form with 400 Bad Request (for example OSS Tables, which only supports dropping tables with purge enabled).

This sends the spec-compliant lowercase "true" / "false" explicitly, matching how the other query parameters in the REST client are serialized. purge_table goes through the same code path.

Are these changes tested?

Two regression tests in tests/catalog/test_rest.py assert the exact query string on the wire for purge_requested=True and for the default False. The assertion is on the raw request URL rather than request.qs because requests_mock lowercases parsed query values, which would hide the bug.

tests/catalog/test_rest.py passes (192 tests) and prek run is clean on the changed files (ruff, ruff-format, mypy, codespell).

Are there any user-facing changes?

RestCatalog.drop_table and purge_table now serialize purgeRequested as a lowercase boolean, fixing 400 responses from servers that validate the parameter strictly.

@kevinjqliu kevinjqliu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

…rge_table

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kevinjqliu

Copy link
Copy Markdown
Contributor

i pushed a change to consolidate the tests based on my agent's suggestion 😄

01002b4

@kevinjqliu
kevinjqliu enabled auto-merge November 11, 2026 17:53

@rambleraptor rambleraptor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I had approved #3837 which it looks like was closed by the stale bot. This looks like the equivalent. Thanks for doing this!

@kevinjqliu
kevinjqliu added this pull request to the merge queue Nov 11, 2026
Merged via the queue into apache:main with commit ab67e68 Nov 11, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] REST catalog drop_table serializes purgeRequested as "True" instead of "true"

3 participants