Title: bigquery.StructQueryParameter should be able to contain structs and arrays · Issue #2905 · googleapis/google-cloud-python · GitHub
Open Graph Title: bigquery.StructQueryParameter should be able to contain structs and arrays · Issue #2905 · googleapis/google-cloud-python
X Title: bigquery.StructQueryParameter should be able to contain structs and arrays · Issue #2905 · googleapis/google-cloud-python
Description: I commented that structs can contain structs and arrays, but the client library does not support it yet. I'm testing this on the master branch. Sample code: from google.cloud import bigquery client = bigquery.Client() query = 'SELECT @st...
Open Graph Description: I commented that structs can contain structs and arrays, but the client library does not support it yet. I'm testing this on the master branch. Sample code: from google.cloud import bigquery client...
X Description: I commented that structs can contain structs and arrays, but the client library does not support it yet. I'm testing this on the master branch. Sample code: from google.cloud import bigquery cl...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/2905
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bigquery.StructQueryParameter should be able to contain structs and arrays","articleBody":"I [commented](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2892#discussion_r93489645) that structs can contain structs and arrays, but the client library does not support it yet.\r\n\r\nI'm testing this on the master branch.\r\n\r\nSample code:\r\n\r\n```python\r\nfrom google.cloud import bigquery\r\n\r\nclient = bigquery.Client()\r\nquery = 'SELECT @struct_value AS s;'\r\nquery_results = client.run_sync_query(\r\n query,\r\n query_parameters=[\r\n bigquery.StructQueryParameter(\r\n 'struct_value',\r\n bigquery.StructQueryParameter(\r\n 'x',\r\n bigquery.ScalarQueryParameter('a', 'INT64', 42),\r\n bigquery.ScalarQueryParameter('b', 'STRING', 'what is the answer?')))\r\n ])\r\n```\r\n\r\n\u003cdetails>\r\n\u003csummary>Stacktrace\u003c/summary>\r\n\u003cpre>\r\n---------------------------------------------------------------------------\r\nAttributeError Traceback (most recent call last)\r\n\u003cipython-input-5-97d23efb85a5> in \u003cmodule>()\r\n 9 'x',\r\n 10 bigquery.ScalarQueryParameter('a', 'INT64', 42),\r\n---> 11 bigquery.ScalarQueryParameter('b', 'STRING', 'what is the answer?')))\r\n 12 ])\r\n\r\n/Users/swast/venvs/google-cloud-python/lib/python3.5/site-packages/google_cloud_bigquery-0.22.1-py3.5.egg/google/cloud/bigquery/_helpers.py in __init__(self, name, *sub_params)\r\n 532 self.name = name\r\n 533 self.struct_types = OrderedDict(\r\n--> 534 (sub.name, sub.type_) for sub in sub_params)\r\n 535 self.struct_values = {sub.name: sub.value for sub in sub_params}\r\n 536 \r\n\r\n/Users/swast/venvs/google-cloud-python/lib/python3.5/site-packages/google_cloud_bigquery-0.22.1-py3.5.egg/google/cloud/bigquery/_helpers.py in \u003cgenexpr>(.0)\r\n 532 self.name = name\r\n 533 self.struct_types = OrderedDict(\r\n--> 534 (sub.name, sub.type_) for sub in sub_params)\r\n 535 self.struct_values = {sub.name: sub.value for sub in sub_params}\r\n 536 \r\n\r\nAttributeError: 'StructQueryParameter' object has no attribute 'type_'\r\n\u003c/pre>\r\n\u003c/details>\r\n\r\nDitto for a struct that contains an array:\r\n\r\n```python\r\nquery_results = client.run_sync_query(\r\n query,\r\n query_parameters=[\r\n bigquery.StructQueryParameter(\r\n 'struct_value',\r\n bigquery.ArrayQueryParameter(\r\n 'y',\r\n 'STRING',\r\n ['hello', 'world']))\r\n ])\r\n```\r\n\r\n\u003cdetails>\r\n\u003csummary>Stacktrace\u003c/summary>\r\n\u003cpre>\r\n---------------------------------------------------------------------------\r\nAttributeError Traceback (most recent call last)\r\n\u003cipython-input-7-be6f219adb88> in \u003cmodule>()\r\n 8 'y',\r\n 9 'STRING',\r\n---> 10 ['hello', 'world']))\r\n 11 ])\r\n\r\n/Users/swast/venvs/google-cloud-python/lib/python3.5/site-packages/google_cloud_bigquery-0.22.1-py3.5.egg/google/cloud/bigquery/_helpers.py in __init__(self, name, *sub_params)\r\n 532 self.name = name\r\n 533 self.struct_types = OrderedDict(\r\n--> 534 (sub.name, sub.type_) for sub in sub_params)\r\n 535 self.struct_values = {sub.name: sub.value for sub in sub_params}\r\n 536 \r\n\r\n/Users/swast/venvs/google-cloud-python/lib/python3.5/site-packages/google_cloud_bigquery-0.22.1-py3.5.egg/google/cloud/bigquery/_helpers.py in \u003cgenexpr>(.0)\r\n 532 self.name = name\r\n 533 self.struct_types = OrderedDict(\r\n--> 534 (sub.name, sub.type_) for sub in sub_params)\r\n 535 self.struct_values = {sub.name: sub.value for sub in sub_params}\r\n 536 \r\n\r\nAttributeError: 'ArrayQueryParameter' object has no attribute 'type_'\r\n\u003c/pre>\r\n\u003c/details>\r\n\r\n","author":{"url":"https://github.com/tswast","@type":"Person","name":"tswast"},"datePublished":"2016-12-28T21:26:51Z","url":"https://github.com/googleapis/google-cloud-python/issues/2905"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:5945e3a1-2f28-8763-c9b3-2a60d1fcb0f5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C888:2FE0A8:90F052:CCFBCA:6AFE1DE5 |
| html-safe-nonce | 4e9b91982a158a0c71b2e48a75ad6d764df0a84ffc132e2b9eb96161e468a93d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODg4OjJGRTBBODo5MEYwNTI6Q0NGQkNBOjZBRkUxREU1IiwidmlzaXRvcl9pZCI6Ijc1NzEyNDY4Mzc0MTYyMDU3OTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 85879612d8093d2188548ddcf89040f22840f70b8b6ccea6b4ab3d7d1d7e9e25 |
| hovercard-subject-tag | issue:197918429 |
| 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/google-cloud-python/2905/issue_layout |
| twitter:image | https://opengraph.githubassets.com/81817ecdd68f288da17ad8429ff827be772e575668af529b1db344ec90320c28/googleapis/google-cloud-python/issues/2905 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/81817ecdd68f288da17ad8429ff827be772e575668af529b1db344ec90320c28/googleapis/google-cloud-python/issues/2905 |
| og:image:alt | I commented that structs can contain structs and arrays, but the client library does not support it yet. I'm testing this on the master branch. Sample code: from google.cloud import bigquery client... |
| 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 | d0525ab1464526bf4532a5551aa348cf100dff75ef808a96fc67a08b1d946aa9 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 16316451 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16316451 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-python |
| 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 | fef3993a71fa20f7be8e167132fbf9619bc66e12 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width