Title: feat: allow QueryJob.result() to be called on a dryRun query · Issue #1012 · googleapis/python-bigquery · GitHub
Open Graph Title: feat: allow QueryJob.result() to be called on a dryRun query · Issue #1012 · googleapis/python-bigquery
X Title: feat: allow QueryJob.result() to be called on a dryRun query · Issue #1012 · googleapis/python-bigquery
Description: Attempting to call result() on a dryRun query results in the following exception. def test_dry_run(bigquery_client: bigquery.Client, query_api_method: str, scalars_table_multi_location: Tuple[str, str]): location, full_table_id = scalars...
Open Graph Description: Attempting to call result() on a dryRun query results in the following exception. def test_dry_run(bigquery_client: bigquery.Client, query_api_method: str, scalars_table_multi_location: Tuple[str, ...
X Description: Attempting to call result() on a dryRun query results in the following exception. def test_dry_run(bigquery_client: bigquery.Client, query_api_method: str, scalars_table_multi_location: Tuple[str, ...
Opengraph URL: https://github.com/googleapis/python-bigquery/issues/1012
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat: allow QueryJob.result() to be called on a dryRun query","articleBody":"Attempting to call `result()` on a dryRun query results in the following exception.\r\n\r\n```\r\n def test_dry_run(bigquery_client: bigquery.Client, query_api_method: str, scalars_table_multi_location: Tuple[str, str]):\r\n location, full_table_id = scalars_table_multi_location\r\n query_config = bigquery.QueryJobConfig()\r\n query_config.dry_run = True\r\n \r\n query_string = f\"SELECT * FROM {full_table_id}\"\r\n query_job = bigquery_client.query(query_string, location=location, job_config=query_config, api_method=query_api_method)\r\n\u003e query_job.result()\r\n\r\ntests/system/test_query.py:430: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\ngoogle/cloud/bigquery/job/query.py:1372: in result\r\n do_get_result()\r\n../python-api-core/google/api_core/retry.py:283: in retry_wrapped_func\r\n return retry_target(\r\n../python-api-core/google/api_core/retry.py:190: in retry_target\r\n return target()\r\ngoogle/cloud/bigquery/job/query.py:1362: in do_get_result\r\n super(QueryJob, self).result(retry=retry, timeout=timeout)\r\ngoogle/cloud/bigquery/job/base.py:713: in result\r\n return super(_AsyncJob, self).result(timeout=timeout, **kwargs)\r\n../python-api-core/google/api_core/future/polling.py:137: in result\r\n raise self._exception\r\ngoogle/cloud/bigquery/job/query.py:1233: in _done_or_raise\r\n self._reload_query_results(retry=retry, timeout=transport_timeout)\r\ngoogle/cloud/bigquery/job/query.py:1214: in _reload_query_results\r\n self._query_results = self._client._get_query_results(\r\ngoogle/cloud/bigquery/client.py:1835: in _get_query_results\r\n resource = self._call_api(\r\ngoogle/cloud/bigquery/client.py:732: in _call_api\r\n return call()\r\n../python-api-core/google/api_core/retry.py:283: in retry_wrapped_func\r\n return retry_target(\r\n../python-api-core/google/api_core/retry.py:190: in retry_target\r\n return target()\r\n\r\n...\r\n\r\nE google.api_core.exceptions.NotFound: 404 GET https://bigquery.googleapis.com/bigquery/v2/projects/swast-scratch/queries/None?maxResults=0\u0026location=asia-northeast1\u0026prettyPrint=false: Not found: Job swast-scratch:asia-northeast1.None\r\nE \r\nE (job ID: None)\r\nE \r\nE -----Query Job SQL Follows----- \r\nE \r\nE | . | . | . | . | . | . | . | . | . |\r\nE 1:SELECT * FROM swast-scratch.python_bigquery_tests_system_20211008194804_6e302d_tokyo.scalars\r\nE | . | . | . | . | . | . | . | . | . |\r\n\r\n../python-cloud-core/google/cloud/_http.py:479: NotFound\r\n```\r\n\r\nThis is because the QueryJob tries to fetch query results and/or job state, but there is no job ID in a dry run query response.\r\n\r\nIMO, if we know something is a dryRun response, `resullt()` should do nothing.","author":{"url":"https://github.com/tswast","@type":"Person","name":"tswast"},"datePublished":"2021-10-08T20:33:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1012/python-bigquery/issues/1012"}
| 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:7e3d9473-d58b-a93e-eaea-10e1299fa6be |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AE90:10F0C1:E54484:14EB118:6A4E2E1C |
| html-safe-nonce | 88b612df3682eea461ca4effa4d242a1b9c01554ade8ffc4c082c00bd9a23a0d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTkwOjEwRjBDMTpFNTQ0ODQ6MTRFQjExODo2QTRFMkUxQyIsInZpc2l0b3JfaWQiOiIzOTAyMzk5MTU2NTU2MDE3MTgwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c3353b58fdce71ef1ada20701d19e4fef7a8d18289e0b348c4ce2f153f9f0936 |
| hovercard-subject-tag | issue:1021443552 |
| 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/1012/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fb325f573a34ee3ae585d951799ae99f48e6b0b4e9d19b61dccf778a9a3de913/googleapis/python-bigquery/issues/1012 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fb325f573a34ee3ae585d951799ae99f48e6b0b4e9d19b61dccf778a9a3de913/googleapis/python-bigquery/issues/1012 |
| og:image:alt | Attempting to call result() on a dryRun query results in the following exception. def test_dry_run(bigquery_client: bigquery.Client, query_api_method: str, scalars_table_multi_location: Tuple[str, ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tswast |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| 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 | d9dd20d38f8ae3c4cb6b597807431db300d0bd2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width