Title: `google.cloud.bigquery.job.QueryJob.exception` has wrong behavior · Issue #451 · googleapis/python-bigquery · GitHub
Open Graph Title: `google.cloud.bigquery.job.QueryJob.exception` has wrong behavior · Issue #451 · googleapis/python-bigquery
X Title: `google.cloud.bigquery.job.QueryJob.exception` has wrong behavior · Issue #451 · googleapis/python-bigquery
Description: 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.c...
Open Graph Description: 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 th...
X Description: 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 th...
Opengraph URL: https://github.com/googleapis/python-bigquery/issues/451
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`google.cloud.bigquery.job.QueryJob.exception` has wrong behavior","articleBody":"Hello,\r\n\r\nAccording to the [documentation](https://googleapis.dev/python/bigquery/latest/generated/google.cloud.bigquery.job.QueryJob.html#google.cloud.bigquery.job.QueryJob.exception) 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:\r\n\r\n```python\r\nfrom google.cloud import bigquery\r\n\r\nclient = bigquery.Client()\r\n\r\n# Correct behavior: returns an exception and does not raise.\r\nquery = 'WRONG QUERY'\r\njob = client.query(query)\r\nexc = job.exception()\r\n\r\n# Wrong behavior: raises an exception instead of returning it.\r\nquery = 'ASSERT (SELECT 2 \u003e 3) AS \"Error !!!\"'\r\njob = client.query(query)\r\ntry:\r\n job.exception()\r\nexcept:\r\n print('raised!')\r\n```\r\n\r\nAm I misunderstanding the documentation or is this the correct behavior?\r\n\r\nI'm using `google-cloud-bigquery==2.6.1` with Python 3.8.6. Let me know if you need more informations.\r\n\r\nThanks for your help,\r\n","author":{"url":"https://github.com/alexandreyc","@type":"Person","name":"alexandreyc"},"datePublished":"2020-12-24T11:47:53.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/451/python-bigquery/issues/451"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ffefa7a0-f5b5-b571-576f-ace61bee7537 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DE5A:3730CE:36788D9:4B1DBFC:6A4F367C |
| html-safe-nonce | 5a090a905884eb0d6bd7e4748dd2243020a188adedef2092bf3910c97877f3af |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTVBOjM3MzBDRTozNjc4OEQ5OjRCMURCRkM6NkE0RjM2N0MiLCJ2aXNpdG9yX2lkIjoiMzM3NzIyNTcxNjgzNTc1OTc0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | de582755e97775678ad9db9ac53343cc83fa0946e219ca74c0fcf6b39480a045 |
| hovercard-subject-tag | issue:774349905 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/python-bigquery/451/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1cc65a07f56cab71139452f6d8af5aad785a81cac674874424b66947dd86dbb5/googleapis/python-bigquery/issues/451 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1cc65a07f56cab71139452f6d8af5aad785a81cac674874424b66947dd86dbb5/googleapis/python-bigquery/issues/451 |
| og:image:alt | 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 th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alexandreyc |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/python-bigquery git https://github.com/googleapis/python-bigquery.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 226992475 |
| octolytics-dimension-repository_nwo | googleapis/python-bigquery |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 226992475 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-bigquery |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width