DG47 opened a new pull request, #4112: URL: https://github.com/apache/iceberg-python/pull/4112
Closes #4111 # Rationale for this change `list_namespaces` passes the parent namespace through `requests`' `params`, which URL-encodes query values. The parts were already quoted by `_encode_namespace_path` (which is meant for path segments), so any part containing a space, `/`, `%` or a non-ASCII character went out encoded twice. For example, the server received `my%20namespace` instead of `my namespace` and could not find the parent. This started when the query string moved to `params=` in #3347. This change joins the raw parts with the configured namespace separator and leaves encoding to `requests`. That matches the Java client, where `RESTUtil.namespaceToQueryParam` joins the levels without encoding them and the server reads the value back with `namespaceFromQueryParam`. Path parameters still go through `_encode_namespace_path`, so they are unchanged. ## Are these changes tested? Yes. There are new tests in `tests/catalog/test_rest.py`. They decode the query string the way a server would and check that `parent` equals the separator-joined namespace, using parts that contain a space, `/`, `%` and non-ASCII characters, plus a custom `namespace-separator`. Without the fix, five of these cases fail. With the fix, all of them pass. `make test` and `make lint` pass. ## Are there any user-facing changes? Yes, a bug fix: `list_namespaces(parent)` now works on REST catalogs when the parent namespace contains characters that need URL encoding. -- 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]
