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:
from google.cloud import bigquery
client = 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.
Thanks for your help,
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.1with Python 3.8.6. Let me know if you need more informations.Thanks for your help,