jayceslesar commented on code in PR #2149:
URL: https://github.com/apache/iceberg-python/pull/2149#discussion_r2396032471
##########
pyiceberg/catalog/rest/__init__.py:
##########
@@ -877,6 +879,18 @@ def drop_view(self, identifier: Union[str]) -> None:
except HTTPError as exc:
_handle_non_200_response(exc, {404: NoSuchViewError})
+ @retry(**_RETRY_ARGS)
+ def rename_view(self, from_identifier: Union[str, Identifier],
to_identifier: Union[str, Identifier]) -> None:
+ payload = {
+ "source": self._split_identifier_for_json(from_identifier),
+ "destination": self._split_identifier_for_json(to_identifier),
+ }
+ response = self._session.post(self.url(Endpoints.rename_view),
json=payload)
+ try:
+ response.raise_for_status()
+ except HTTPError as exc:
+ _handle_non_200_response(exc, {404: NoSuchViewError, 409:
ViewAlreadyExistsError})
Review Comment:
ah it seems that this issue is not unique to this PR, I think it deserves a
separate issue for example
[rename_table](https://github.com/apache/iceberg-python/blob/main/pyiceberg/catalog/rest/__init__.py#L652)
is also supposed to throw a `NoSuchNamespaceError` in similar fashion, which
is also outlined in the
[spec](https://github.com/apache/iceberg/blob/00d18e38feb5439f715ee3c13e206e9445ed2faa/open-api/rest-catalog-open-api.yaml#L1257)
but it does not.
I am going to approve on the basis that we should fix this in a separate PR!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]