geruh commented on code in PR #2848:
URL: https://github.com/apache/iceberg-python/pull/2848#discussion_r2648812105
##########
pyiceberg/catalog/rest/__init__.py:
##########
@@ -327,6 +437,18 @@ def url(self, endpoint: str, prefixed: bool = True,
**kwargs: Any) -> str:
return url + endpoint.format(**kwargs)
+ def _check_endpoint(self, endpoint: Endpoint) -> None:
+ """Check if an endpoint is supported by the server.
+
+ Args:
+ endpoint: The endpoint to check against the set of supported
endpoints
+
+ Raises:
+ NotImplementedError: If the endpoint is not supported.
+ """
+ if endpoint not in self._supported_endpoints:
+ raise NotImplementedError(f"Server does not support endpoint:
{endpoint}")
Review Comment:
There really isn't an exact equivalent for java's
`UnsupportedOperationException` exception in python. I went with
`NotImplementedError` since it's the closest. Alternatively, we can go with
RuntimeException.
--
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]