You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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:
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 :)
@kravets-levko one way to handle this is to check whether the user passed a None value versus the None default being used. Easiest way to achieve this is with a singleton object which you could call NotPassed. If you then set the default value in .connect() to this value, you can assert that nothing was passed and bail to the oauth flow. Whereas if the user passed a None value you can raise a nice exception that tells them something in their code is out of whack.
Activity
kravets-levko commentedon Oct 23, 2024
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:
wallystart commentedon Oct 23, 2024
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
kravets-levko commentedon Oct 23, 2024
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).
PECO-2054
wallystart commentedon Oct 25, 2024
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!
susodapop commentedon Oct 28, 2024
@kravets-levko one way to handle this is to check whether the user passed a
Nonevalue versus theNonedefault being used. Easiest way to achieve this is with a singleton object which you could callNotPassed. If you then set the default value in.connect()to this value, you can assert that nothing was passed and bail to the oauth flow. Whereas if the user passed a None value you can raise a nice exception that tells them something in their code is out of whack.susodapop commentedon Oct 29, 2024
I opened a pull request that implements the pattern described above: #462
peco-engineer-bot commentedon Jul 23, 2026
🤖 engineer-bot opened a fix PR: #876
Review before merge.