From 501814706efce2358b1dab752cb11caec4d00e01 Mon Sep 17 00:00:00 2001 From: Lei Zhanglei <1091517373@qq.com> Date: Mon, 24 Aug 2026 19:27:29 +0800 Subject: [PATCH] fix(rest-catalog): serialize purgeRequested as lowercase boolean string * Python's requests library serializes bool True as "True" (capitalized) in query parameters. Per OpenAPI 3.0 spec (JSON Schema Wright Draft 00, RFC 7159 Section 3), boolean query parameters must be serialized as lowercase "true"/"false". Servers that strictly validate boolean values (e.g., Aliyun OSS Tables) reject "True" with 400 Bad Request. * Use explicit "true"/"false" string literals for spec-compliant wire format. --- pyiceberg/catalog/rest/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyiceberg/catalog/rest/__init__.py b/pyiceberg/catalog/rest/__init__.py index 97a71b429b..9e59917f60 100644 --- a/pyiceberg/catalog/rest/__init__.py +++ b/pyiceberg/catalog/rest/__init__.py @@ -1132,7 +1132,7 @@ def drop_table(self, identifier: str | Identifier, purge_requested: bool = False self._check_endpoint(Capability.V1_DELETE_TABLE) response = self._session.delete( self.url(Endpoints.drop_table, prefixed=True, **self._split_identifier_for_path(identifier)), - params={"purgeRequested": purge_requested}, + params={"purgeRequested": "true" if purge_requested else "false"}, ) try: response.raise_for_status()