This is an automated email from the ASF dual-hosted git repository. sungwy pushed a commit to branch pyiceberg-0.7.x in repository https://gitbox.apache.org/repos/asf/iceberg-python.git
commit 2818cd71dbc0425ee8dfcd9030adff74b6f408a8 Author: Andre Luis Anastacio <[email protected]> AuthorDate: Tue Aug 6 19:38:25 2024 -0300 Fix list namespace response in rest catalog (#995) --- pyiceberg/catalog/rest.py | 3 +-- tests/catalog/test_rest.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pyiceberg/catalog/rest.py b/pyiceberg/catalog/rest.py index e6fbabf5..1349fe56 100644 --- a/pyiceberg/catalog/rest.py +++ b/pyiceberg/catalog/rest.py @@ -757,8 +757,7 @@ class RestCatalog(Catalog): except HTTPError as exc: self._handle_non_200_response(exc, {}) - namespaces = ListNamespaceResponse(**response.json()) - return [namespace_tuple + child_namespace for child_namespace in namespaces.namespaces] + return ListNamespaceResponse(**response.json()).namespaces @retry(**_RETRY_ARGS) def load_namespace_properties(self, namespace: Union[str, Identifier]) -> Properties: diff --git a/tests/catalog/test_rest.py b/tests/catalog/test_rest.py index 86b6baef..fe9a32fe 100644 --- a/tests/catalog/test_rest.py +++ b/tests/catalog/test_rest.py @@ -419,7 +419,7 @@ def test_list_namespaces_200(rest_mock: Mocker) -> None: def test_list_namespace_with_parent_200(rest_mock: Mocker) -> None: rest_mock.get( f"{TEST_URI}v1/namespaces?parent=accounting", - json={"namespaces": [["tax"]]}, + json={"namespaces": [["accounting", "tax"]]}, status_code=200, request_headers=TEST_HEADERS, )
