-
Notifications
You must be signed in to change notification settings - Fork 94
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
If the token is null, the connection hangs #458
Comments
Hi @wallystart! In v3.4.0, when you omit PAT, U2M OAuth will be used. It means that library will try to open browser tab and ask to log in. If browser wasn't open for some reason - it may look like the whole thing hung up. I'm curious how you run your script, and in which environment. Also, please enable debug mode (add following lines in beginning of your script) and share the full log you'll get from the library: import logging
logging.basicConfig(level=logging.DEBUG) |
Hi @kravets-levko ! Thanks for your answer. Probably it wasn't open because i'm running this on a Databricks notebook. Here the full log
Regards |
Hi @wallystart! Yes, logs clearly indicate that library tries to use U2M OAuth flow, which implies opening link in a browser. Unfortunately, that's expected behavior, so if you need to use the library in a notebook - you have to provide access token. Although, I will keep this issue open - we definitely need to handle this use case (maybe, throw an error if library cannot open an OAuth link). |
Hi @kravets-levko! Thanks for your response. Yes, we do provide an access token, but in this case, it was due to our bug (generating a null access token). We’ve already fixed it, but I opened this issue so you can analyze and determine if it needs further action :) Thanks again! |
@kravets-levko one way to handle this is to check whether the user passed a |
I opened a pull request that implements the pattern described above: #462 |
Hi, today we were troubleshooting a process that uses databricks-sql-python. The connection hangs if the token is null.
Evidence to reproduce:
(The cell never ends)
Generating token it ends correctly:
We are using databricks-sql-connector==3.4.0
Thanks!
The text was updated successfully, but these errors were encountered: