Closed gerilya closed 7 months ago
If an attempt to load keyring module fails, there is a fall back to _OAuth2TokenInMemoryCache. I think no backends or having keyring.backends.null.Keyring backend should be treated the same way. Using keyring.backends.null.Keyring backend is the recommended way to disable keyring. See Disabling Keyring at https://pypi.org/project/keyring/
keyring.backends.null.Keyring
Disabling Keyring
When there is keyring package installed but there are no available backends, the following error is generated:
keyring
Although keyring module is installed no backend has been detected, check https://pypi.org/project/keyring/ for more information.
Run the following code on Sagemaker notebook instance:
import trino connect = trino.dbapi.connect( host=config['HOST'], port=config['PORT'], http_scheme=config['PROTOCOL'], auth=trino.auth.OAuth2Authentication(), user=config['USERNAME'], ) cursor=connect.cursor() query="some query" cursor.execute(query)
[ 2023-12-14T09:53:41.370244 | Although keyring module is installed no backend has been detected, check https://pypi.org/project/keyring/ for more information. ]
AWS Sagemaker Notebook
0.327.0
can't connect - not relevant
Python 3.10.13
@hovaesco can this be closed after #435?
@hashhar Yes.
Resolved by https://github.com/trinodb/trino-python-client/pull/435
Expected behavior
If an attempt to load keyring module fails, there is a fall back to _OAuth2TokenInMemoryCache. I think no backends or having
keyring.backends.null.Keyring
backend should be treated the same way. Usingkeyring.backends.null.Keyring
backend is the recommended way to disable keyring. SeeDisabling Keyring
at https://pypi.org/project/keyring/Actual behavior
When there is
keyring
package installed but there are no available backends, the following error is generated:Steps To Reproduce
Run the following code on Sagemaker notebook instance:
Log output
[ 2023-12-14T09:53:41.370244 | Although keyring module is installed no backend has been detected, check https://pypi.org/project/keyring/ for more information. ]
Operating System
AWS Sagemaker Notebook
Trino Python client version
0.327.0
Trino Server version
can't connect - not relevant
Python version
Python 3.10.13
Are you willing to submit PR?