-
Notifications
You must be signed in to change notification settings - Fork 267
Fix thrift client connection for Kerberos Hive Client #1747
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
Conversation
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.
IMHO, it would be better to define the client as a cached_property, and just return it.
+1 for moving the init out of the __init__
func, and converting the client to a cached_property
will help to do this, where the user will be able to use the client with and without a context manager.
@kevinjqliu I think this one is also good for 0.9.1 |
Gentle ping @kevinjqliu. Any thoughts on the |
Hi @hussein-awala, just to make sure I have this right, would this mean moving most of the logic in Edit: I'm asking because there might be cases where the above could actually result in a user invoking methods on a client whose underlying transport has been closed. For example: hive_client = _HiveClient(...)
p_client = hive_client.client
with hive_client as open_client:
print(open_client.get_all_databases())
print(p_client.get_all_databases()) # Results in TTransportException: Transport not open So its likely that this is not what you meant. |
Thanks for chiming in @hussein-awala @mnzpk. Please take a look at the new implementation. The context manager ( @mnzpk could you give this a try? |
6b8d2ee
to
7b21b5b
Compare
CI's currently failing for main branch, see https://github.com/apache/iceberg-python/pull/1899/files#r2040915222
|
7b21b5b
to
d788c8d
Compare
cool CI passes now @mnzpk please take a look when you have time :) |
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 fixing this @kevinjqliu 🙌
Closes #1744 `TSaslClientTransport` cannot be reopen. This PR changes the behavior to recreate a `TSaslClientTransport` when its already closed. Note, `_HiveClient` should be used with context manager, but can be used without.
Closes #1744
TSaslClientTransport
cannot be reopen. This PR changes the behavior to recreate aTSaslClientTransport
when its already closed.Note,
_HiveClient
should be used with context manager, but can be used without.