Skip to content

Commit 8432b11

Browse files
authored
Fix list namespace response in rest catalog (#995)
1 parent bfe9991 commit 8432b11

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
@@ -758,8 +758,7 @@ def list_namespaces(self, namespace: Union[str, Identifier] = ()) -> List[Identi
758758
except HTTPError as exc:
759759
self._handle_non_200_response(exc, {})
760760

761-
namespaces = ListNamespaceResponse(**response.json())
762-
return [namespace_tuple + child_namespace for child_namespace in namespaces.namespaces]
761+
return ListNamespaceResponse(**response.json()).namespaces
763762

764763
@retry(**_RETRY_ARGS)
765764
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)