Skip to content

Commit

Permalink
Fix list namespace response in rest catalog (#995)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndrluis authored Aug 6, 2024
1 parent bfe9991 commit 8432b11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions pyiceberg/catalog/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,8 +758,7 @@ def list_namespaces(self, namespace: Union[str, Identifier] = ()) -> List[Identi
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:
Expand Down
2 changes: 1 addition & 1 deletion tests/catalog/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down

0 comments on commit 8432b11

Please sign in to comment.