Anurag-S1ngh opened a new pull request, #4341:
URL: https://github.com/apache/iceberg-python/pull/4341

   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.
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to