Skip to content

Commit 2653e33

Browse files
ndrluissungwy
authored andcommitted
Fix list namespace response in rest catalog (apache#995)
1 parent 173b84e commit 2653e33

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pyiceberg/catalog/rest.py

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

755-
namespaces = ListNamespaceResponse(**response.json())
756-
return [namespace_tuple + child_namespace for child_namespace in namespaces.namespaces]
755+
return ListNamespaceResponse(**response.json()).namespaces
757756

758757
@retry(**_RETRY_ARGS)
759758
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)