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)}
Autodetect feature works only if the body of the request contains a schema field.
For example, that works fine:
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):