jayceslesar commented on code in PR #2149:
URL: https://github.com/apache/iceberg-python/pull/2149#discussion_r2392950485
##########
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:
Looks like we are supposed to return a `NoSuchNamespaceError` in the case
that the namespace doesnt exist
https://github.com/apache/iceberg/blob/00d18e38feb5439f715ee3c13e206e9445ed2faa/open-api/rest-catalog-open-api.yaml#L1771
--
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]