-
Notifications
You must be signed in to change notification settings - Fork 308
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
google.cloud.bigquery.job.QueryJob.exception
has wrong behavior
#451
Comments
@tswast @busunkim96 Please suggest. I am not sure about to handle this in |
Working on something related, I discovered that the problem does not exist when doing a double assertion: # Correct behavior: returns an exception and does not raise.
query = 'ASSERT (SELECT 2 > 3) AS "Error !!!"; ASSERT (SELECT 2 > 3) AS "Error again !!!";'
job = client.query(query)
exc = job.exception() Hope it can help... Thanks, |
@tswast Backend consider "INVALID_ARGUMENT" and gave the reason "invalidQuery" when query contains |
Regarding #451 (comment) I believe this is a difference in backend API behavior of CC @shollyman |
Regarding this issue, it appears that this library may be using the Instead, it is expected that set_exception() is called. We do this here:
But we are missing the case when the We probably need a try-catch block in
If |
@tswast Has this proposal been confirmed? If yes, I can start implementing it (as there's no assignee on the ticket yet). |
Yes. Let's make sure that |
|
Hello,
According to the documentation of
google.cloud.bigquery.job.QueryJob.exception
, this method should returns an exception (and not raises) if something went wrong. But according to my tests this is not always the case:Am I misunderstanding the documentation or is this the correct behavior?
I'm using
google-cloud-bigquery==2.6.1
with Python 3.8.6. Let me know if you need more informations.Thanks for your help,
The text was updated successfully, but these errors were encountered: