-
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.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
Autodetect feature works only if the body of the request contains a schema field.
For example, that works fine:
job = {
'projectId': PROJECT_ID,
'configuration': {
'load': {
'autodetect': True, # works without it, by default autodetect = True
'destinationTable': {
'projectId': PROJECT_ID,
'datasetId': self.dataset,
'tableId': self.table,
},
'sourceUris': [self.path],
'writeDisposition': self.write_disposition
}
}
}The task will be failed if schema path is not specified in the task params.
May be this code in the client works unexpected(job.py):
resource = {
'jobReference': {
'projectId': self.project,
'jobId': self.name,
},
'configuration': {
self._JOB_TYPE: {
'sourceUris': self.source_uris,
'destinationTable': {
'projectId': self.destination.project,
'datasetId': self.destination.dataset_name,
'tableId': self.destination.name,
},
},
},
}
configuration = resource['configuration'][self._JOB_TYPE]
self._populate_config_resource(configuration)
if len(self.schema) > 0:
configuration['schema'] = {
'fields': _build_schema_resource(self.schema)}arpradhan, DanWilkerson, max-sixty, gogolaylago, gyangscrf and 2 more
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.