-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
>>> dataset = client.dataset('dataset_name')
>>> table = dataset.table(name='person_ages')
>>> job = client.run_async_query('fullname-age-query-job', query)
>>> job.destination = table
>>> job.write_disposition= 'WRITE_TRUNCATE'
>>> job.name
'fullname-age-query-job'
>>> job.job_type
'query'
>>> job.created
None
>>> job.state
Nonehow about a better api by allowing arbitrary keyword list to be appended on the insert job POST request
https://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
>>> job = client.run_async_query(query,
destinationTable={'datasetId': 'dataset_name', 'tableId': 'person_ages'},
writeDisposition='WRITE_TRUNCATE',
)in python it can be implemented as dict as last argument:
def run_async_query(query, **kwargs):
# populate from kwargs to be on the `configuration.query` in the post request body,
# it could optionally have jobIdBtw, 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
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.