Title: feature request: better api for arbitrary keyword argument pass to query ? · Issue #3210 · googleapis/google-cloud-python · GitHub
Open Graph Title: feature request: better api for arbitrary keyword argument pass to query ? · Issue #3210 · googleapis/google-cloud-python
X Title: feature request: better api for arbitrary keyword argument pass to query ? · Issue #3210 · googleapis/google-cloud-python
Description: from this example https://googlecloudplatform.github.io/google-cloud-python/stable/bigquery-usage.html#querying-data-asynchronous >>> dataset = client.dataset('dataset_name') >>> table = dataset.table(name='person_ages') >>> job = client...
Open Graph Description: from this example https://googlecloudplatform.github.io/google-cloud-python/stable/bigquery-usage.html#querying-data-asynchronous >>> dataset = client.dataset('dataset_name') >>> table = dataset.ta...
X Description: from this example https://googlecloudplatform.github.io/google-cloud-python/stable/bigquery-usage.html#querying-data-asynchronous >>> dataset = client.dataset('dataset_name') >&...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/3210
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feature request: better api for arbitrary keyword argument pass to query ?","articleBody":"from this example https://googlecloudplatform.github.io/google-cloud-python/stable/bigquery-usage.html#querying-data-asynchronous\r\n\r\n```python\r\n\u003e\u003e\u003e dataset = client.dataset('dataset_name')\r\n\u003e\u003e\u003e table = dataset.table(name='person_ages')\r\n\u003e\u003e\u003e job = client.run_async_query('fullname-age-query-job', query)\r\n\u003e\u003e\u003e job.destination = table\r\n\u003e\u003e\u003e job.write_disposition= 'WRITE_TRUNCATE'\r\n\u003e\u003e\u003e job.name\r\n'fullname-age-query-job'\r\n\u003e\u003e\u003e job.job_type\r\n'query'\r\n\u003e\u003e\u003e job.created\r\nNone\r\n\u003e\u003e\u003e job.state\r\nNone\r\n```\r\n\r\nhow about a better api by allowing arbitrary keyword list to be appended on the insert job POST request\r\nhttps://cloud.google.com/bigquery/docs/reference/rest/v2/jobs the keyword `destinationTable` and `writeDisposition` here are from rest api reference, this way can keep `google-cloud-python` library to be a thinner layer, just gives user the best flexibility\r\n\r\n```python\r\n\u003e\u003e\u003e job = client.run_async_query(query,\r\n destinationTable={'datasetId': 'dataset_name', 'tableId': 'person_ages'},\r\n writeDisposition='WRITE_TRUNCATE',\r\n )\r\n```\r\n\r\nin python it can be implemented as dict as last argument:\r\n\r\n```python\r\ndef run_async_query(query, **kwargs):\r\n # populate from kwargs to be on the `configuration.query` in the post request body,\r\n # it could optionally have jobId\r\n```\r\n\r\nBtw, from #3209 I am not puting a `job_name` / `jobid` field because I don't think that's necessary, the `run_async_query` shouldn't require user to provide a `jobid`, in the rest api insert job request, if jobid is absent, server side would generate a unique id","author":{"url":"https://github.com/c0b","@type":"Person","name":"c0b"},"datePublished":"2017-03-27T04:20:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/3210/google-cloud-python/issues/3210"}
| 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:4deba97f-d0c4-4d34-6f88-a8af7a36d66e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 91FC:2B6D8B:1679BC:1E4610:6A4D8537 |
| html-safe-nonce | a01b38afe306687033f3d52688197ddc3ce01c1592620558f745f4b22296ef62 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MUZDOjJCNkQ4QjoxNjc5QkM6MUU0NjEwOjZBNEQ4NTM3IiwidmlzaXRvcl9pZCI6IjIwODIwNTQwMTA2MjIwMTg4NzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b93580411d1cd2bb084682ca9773345ec446b3be26cfcd80a16f2cac75ca90db |
| hovercard-subject-tag | issue:217132958 |
| 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/3210/issue_layout |
| twitter:image | https://opengraph.githubassets.com/42bad12ffa7f51e4b67b1eb5fbf26d3d5ee9ef9569f4cbf0a7a0841d9a54061b/googleapis/google-cloud-python/issues/3210 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/42bad12ffa7f51e4b67b1eb5fbf26d3d5ee9ef9569f4cbf0a7a0841d9a54061b/googleapis/google-cloud-python/issues/3210 |
| og:image:alt | from this example https://googlecloudplatform.github.io/google-cloud-python/stable/bigquery-usage.html#querying-data-asynchronous >>> dataset = client.dataset('dataset_name') >>> table = dataset.ta... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | c0b |
| hostname | github.com |
| expected-hostname | github.com |
| None | c6bf61c909482ec3072ef5d7a5a28f2a9d214788c9a44793eca1960048cb05ae |
| 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 | 6702a58b419a792226bd21ef0fb1bcb318bbcaa3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width