Title: BigQuery: refactor `bigquery_query_params_*` code samples to pass `query_parameters` to `QueryJobConfig` constructor · Issue #9596 · googleapis/google-cloud-python · GitHub
Open Graph Title: BigQuery: refactor `bigquery_query_params_*` code samples to pass `query_parameters` to `QueryJobConfig` constructor · Issue #9596 · googleapis/google-cloud-python
X Title: BigQuery: refactor `bigquery_query_params_*` code samples to pass `query_parameters` to `QueryJobConfig` constructor · Issue #9596 · googleapis/google-cloud-python
Description: Is your feature request related to a problem? Please describe. The code samples for using query parameters are a bit hard to follow because they create several temporary variables. google-cloud-python/bigquery/docs/snippets.py Lines 1868...
Open Graph Description: Is your feature request related to a problem? Please describe. The code samples for using query parameters are a bit hard to follow because they create several temporary variables. google-cloud-pyt...
X Description: Is your feature request related to a problem? Please describe. The code samples for using query parameters are a bit hard to follow because they create several temporary variables. google-cloud-pyt...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/9596
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"BigQuery: refactor `bigquery_query_params_*` code samples to pass `query_parameters` to `QueryJobConfig` constructor ","articleBody":" **Is your feature request related to a problem? Please describe.**\r\n\r\nThe code samples for using query parameters are a bit hard to follow because they create several temporary variables.\r\n\r\nhttps://github.com/googleapis/google-cloud-python/blob/518931bb306ed7cb78ce76323fbde289fbc15338/bigquery/docs/snippets.py#L1868-L1873\r\n\r\nThe code samples are still in `snippets.py`. Ideally these samples would be moved to the `samples/` directory.\r\n\r\nThe code samples supply a `location` argument for queries, even though this can now be autodetected for queries in all regions.\r\n\r\n **Describe the solution you'd like**\r\nA clear and concise description of what you want to happen.\r\n\r\n- [ ] Move any `bigquery_query_params_...` samples to the `samples/` directory.\r\n- [ ] Remove the `location` argument from the `query()` method in the moved code samples\r\n- [ ] Use the `query_parameters` argument in the constructor to `QueryJobConfig` (added in https://github.com/googleapis/google-cloud-python/pull/6397).\r\n\r\n```python\r\njob_config = bigquery.QueryJobConfig(\r\n query_parameters=[\r\n bigquery.ScalarQueryParameter(\"corpus\", \"STRING\", \"romeoandjuliet\"),\r\n bigquery.ScalarQueryParameter(\"min_word_count\", \"INT64\", 250),\r\n ],\r\n)\r\n```\r\n\r\n **Describe alternatives you've considered**\r\nA clear and concise description of any alternative solutions or features you've considered.\r\n\r\nN/A\r\n\r\n **Additional context**\r\nAdd any other context or screenshots about the feature request here.\r\n\r\nReported by customer in internal issue 143862711.\r\n","author":{"url":"https://github.com/tswast","@type":"Person","name":"tswast"},"datePublished":"2019-11-04T18:42:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/9596/google-cloud-python/issues/9596"}
| 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:4fa5fb6c-7949-957b-7aea-662f3f23d78f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C6C:3EE845:38AB45A:4DA1A77:6A4F2439 |
| html-safe-nonce | 124fe5f0ea3d0493ecd237b1323e50eea0cbd20c7e1fc3363a6f579a03f92695 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzZDOjNFRTg0NTozOEFCNDVBOjREQTFBNzc6NkE0RjI0MzkiLCJ2aXNpdG9yX2lkIjoiNTIwMzI1NDM0MTQ1Mjg5OTM4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 643c22ab8601f65c6b23769a4a896496ade44a8488e1a36ece9fe78ec5c641db |
| hovercard-subject-tag | issue:517332076 |
| 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/9596/issue_layout |
| twitter:image | https://opengraph.githubassets.com/74251ceebe55aa4197409088fdb5dc97d09ec3748f4f73273ac0a2df9cf5a455/googleapis/google-cloud-python/issues/9596 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/74251ceebe55aa4197409088fdb5dc97d09ec3748f4f73273ac0a2df9cf5a455/googleapis/google-cloud-python/issues/9596 |
| og:image:alt | Is your feature request related to a problem? Please describe. The code samples for using query parameters are a bit hard to follow because they create several temporary variables. google-cloud-pyt... |
| 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 | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| 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 | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width