Skip to content

Commit 8f6de7b

Browse files
ndrluissungwy
authored andcommitted
Fix list namespace response in rest catalog (apache#995)
1 parent 446e4fa commit 8f6de7b

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

pyiceberg/catalog/rest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,7 @@ def list_namespaces(self, namespace: Union[str, Identifier] = ()) -> List[Identi
755755
except HTTPError as exc:
756756
self._handle_non_200_response(exc, {})
757757

758-
namespaces = ListNamespaceResponse(**response.json())
759-
return [namespace_tuple + child_namespace for child_namespace in namespaces.namespaces]
758+
return ListNamespaceResponse(**response.json()).namespaces
760759

761760
@retry(**_RETRY_ARGS)
762761
def load_namespace_properties(self, namespace: Union[str, Identifier]) -> Properties:

tests/catalog/test_rest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def test_list_namespaces_200(rest_mock: Mocker) -> None:
419419
def test_list_namespace_with_parent_200(rest_mock: Mocker) -> None:
420420
rest_mock.get(
421421
f"{TEST_URI}v1/namespaces?parent=accounting",
422-
json={"namespaces": [["tax"]]},
422+
json={"namespaces": [["accounting", "tax"]]},
423423
status_code=200,
424424
request_headers=TEST_HEADERS,
425425
)

0 commit comments

Comments
 (0)