HonahX commented on code in PR #962:
URL: https://github.com/apache/iceberg-python/pull/962#discussion_r1693532560
##########
pyiceberg/catalog/rest.py:
##########
@@ -290,11 +293,38 @@ def url(self, endpoint: str, prefixed: bool = True,
**kwargs: Any) -> str:
@property
def auth_url(self) -> str:
- if url := self.properties.get(AUTH_URL):
+ if self.properties.get(AUTH_URL):
+ deprecation_message(
+ deprecated_in="0.7.0",
+ removed_in="0.8.0",
+ help_message=f"The property {AUTH_URL} is deprecated. Please
use {OAUTH2_SERVER_URI} instead",
+ )
+
+ self._warn_oauth_tokens_deprecation()
+
+ if url := PropertyUtil.get_first_property_value(self.properties,
AUTH_URL, OAUTH2_SERVER_URI):
return url
else:
return self.url(Endpoints.get_token, prefixed=False)
+ def _warn_oauth_tokens_deprecation(self) -> None:
+ has_oauth_server_uri = OAUTH2_SERVER_URI in self.properties
+ has_credential = CREDENTIAL in self.properties
+ has_init_token = TOKEN in self.properties
+ has_sigv4_enabled = strtobool(self.properties.get(SIGV4, "false"))
+
+ if not has_oauth_server_uri and (has_init_token or has_credential) and
not has_sigv4_enabled:
+ deprecation_message(
+ deprecated_in="0.7.0",
+ removed_in="future Iceberg release",
Review Comment:
Thanks for pointing this out!
> I believe that 1.8.0 could be released before pyiceberg 1.0.0, but we
cannot know if the endpoint will be removed in version 1.8.0.
I think we can update the version to a later one (e.g. `1.2.0`) in the
following releases. So, it looks good to aim for `1.0.0` now.
Another concern is that "future iceberg release" may add confusion since
this could mean any version after `0.7.0`. So, I prefer to at least include a
version number in the `removed_in` message.
Would love to hear your thoughts on this!
--
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]