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
{{ message }}
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
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:
fromgoogle.cloudimportbigqueryclient=bigquery.Client()
# Correct behavior: returns an exception and does not raise.query='WRONG QUERY'job=client.query(query)
exc=job.exception()
# Wrong behavior: raises an exception instead of returning it.query='ASSERT (SELECT 2 > 3) AS "Error !!!"'job=client.query(query)
try:
job.exception()
except:
print('raised!')
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.