-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate rest.authorization-url in favor of oauth2-server-uri #962
Conversation
pyiceberg/catalog/rest.py
Outdated
@@ -290,7 +293,14 @@ 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(DEPRECATED_AUTH_URL): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the logic is a bit more elaborate, see: https://github.com/apache/iceberg/pull/10603/files#diff-86450612dbe323d6d06cbc3846aa1913f042eaedadc0ca027c36bfbe08d3a46cR196
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial purpose of this PR was not to warn about the /oauth/tokens
endpoint deprecation, it was only to fix the configuration property, but I can add this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating the PyIceberg code here @ndrluis Could you update the docs as well?
The deprecated decorator adds a message that does not make sense for the properties deprecation. I will add a new function and change where is a property deprecation and are using the deprecated decorator. |
@Fokko Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ndrluis Thanks for working on this! Left some comments about minor stuff. Overall it looks great!
pyiceberg/utils/deprecated.py
Outdated
|
||
|
||
def deprecation_message(deprecated_in: str, removed_in: str, help_message: Optional[str]) -> None: | ||
"""Mark properties as deprecated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently we only use this to deprecate properties. But in the future, we may use it to deprecate other things like parameters. How about just making a general comment here saying that adding this will thrown a deprecation warning?
pyiceberg/catalog/rest.py
Outdated
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am following what is described in the Java implementation. In the deprecation proposal, it is aimed to be removed in version 1.8.0 or 2.0.0. 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.
So, I don't have a strong opinion; I am open to what you think is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in 6e253c2
Hi @ndrluis - that sounds like a good idea. We have been working on making the release for 0.7.0 for a while, which already comes with many exciting features users have been waiting on. For the last few weeks, I have been mostly working on introducing critical bug fixes into this release so we can finally make it onto the other side 🙂 If it’s alright with you, could we update this and target this change for 0.8.0 as you suggested? |
Updated deprecated version in commit 1039ac3 |
8cfd954
to
913ee61
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you for working on this @ndrluis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @ndrluis !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return func(*args, **kwargs) | ||
|
||
return new_func | ||
|
||
return decorator | ||
|
||
|
||
def deprecation_message(deprecated_in: str, removed_in: str, help_message: Optional[str]) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition, I like it a lot 👍
The purpose of this PR is to follow the OAuth property standard as defined in the Java implementation and the REST Catalog specification: https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml#L144-L145.
Deprecation message about the oauth tokens behavior:
Deprecation message about the property: