HonahX commented on code in PR #962:
URL: https://github.com/apache/iceberg-python/pull/962#discussion_r1693491040
##########
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:
I am a little worried that this may get lost since this is not a version
number. How about we remove this in the next major release: `1.0.0`?
--
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]