Title: BigQuery: [Primitive-ize API] SchemaField · Issue #8196 · googleapis/google-cloud-python · GitHub
Open Graph Title: BigQuery: [Primitive-ize API] SchemaField · Issue #8196 · googleapis/google-cloud-python
X Title: BigQuery: [Primitive-ize API] SchemaField · Issue #8196 · googleapis/google-cloud-python
Description: Consistent with the recent work to allow the API to accept some primitives as well as specific objects, the schema argument to LoadJobConfig* could accept a list of dicts. Currently it requires constructing a bunch of SchemaField objects...
Open Graph Description: Consistent with the recent work to allow the API to accept some primitives as well as specific objects, the schema argument to LoadJobConfig* could accept a list of dicts. Currently it requires con...
X Description: Consistent with the recent work to allow the API to accept some primitives as well as specific objects, the schema argument to LoadJobConfig* could accept a list of dicts. Currently it requires con...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/8196
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"BigQuery: [Primitive-ize API] SchemaField","articleBody":"Consistent with the recent work to allow the API to accept some primitives as well as specific objects, the schema argument to `LoadJobConfig`* could accept a list of dicts. Currently it requires constructing a bunch of `SchemaField` objects:\r\n\r\n```python\r\n\r\n schema = [\r\n # could be just column_dicts\r\n bigquery.schema.SchemaField.from_api_repr(column_dict) for column_dict in column_dicts\r\n ]\r\n\r\n with open(empty_path, \"rb\") as source_file: \r\n job_config = bigquery.job.LoadJobConfig(\r\n schema=schema, write_disposition=\"WRITE_TRUNCATE\"\r\n )\r\n\r\n job = gbq_client.load_table_from_file(\r\n source_file,\r\n table_ref,\r\n location=\"US\",\r\n job_config=job_config,\r\n )\r\n```\r\n\r\nWe're trying to move to using the BQ Python API rather than subprocessing out to a shell with `bq`; it's got much better but it's still a bit Java-esque, and these are examples of times it's a tougher sell than constructing a string a sending it to bash. As ever, lmk if the API isn't designed for these cases and you'd encourage users to use bash.\r\n\r\n*this could also be a dict, though less of an imperative.\r\n\r\n","author":{"url":"https://github.com/max-sixty","@type":"Person","name":"max-sixty"},"datePublished":"2019-05-30T16:10:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/8196/google-cloud-python/issues/8196"}
| 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:df52f9e8-ef3f-2c9e-2c89-99db868bbf29 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CABE:1C7367:16CE50B:213573B:6A4E511B |
| html-safe-nonce | 65717161ebef8da80994a28f16394bedc6505031e6877af33f483329036666d7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQUJFOjFDNzM2NzoxNkNFNTBCOjIxMzU3M0I6NkE0RTUxMUIiLCJ2aXNpdG9yX2lkIjoiNTAxOTQyMDcwMDI3Nzg4NzI1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e83bfe1d404cb2cd4dc3e6452d554135c4b5fdf0da1928b7c7dd99e8b2353d71 |
| hovercard-subject-tag | issue:450384588 |
| 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/8196/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e6734ef7f179d415f5b09e56eb91774752ddaae2da3d0bfc4ed58ef1e947043a/googleapis/google-cloud-python/issues/8196 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e6734ef7f179d415f5b09e56eb91774752ddaae2da3d0bfc4ed58ef1e947043a/googleapis/google-cloud-python/issues/8196 |
| og:image:alt | Consistent with the recent work to allow the API to accept some primitives as well as specific objects, the schema argument to LoadJobConfig* could accept a list of dicts. Currently it requires con... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | max-sixty |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| 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 | f344f1eab54fc7dfc02d0d018cda7e158c3db65c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width