You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "load_data_from_file.py", line 74, in <module>
args.source_file_anme)
File "load_data_from_file.py", line 40, in load_data_from_gcs
source_file, source_format='text/csv', rewind=True)
File "/Users/jonwayne/workspace/python-docs-samples/bigquery/cloud-client/env/lib/python3.4/site-packages/gcloud/bigquery/table.py", line 913, in upload_from_file
return client.job_from_resource(json.loads(response_content))
File "/Users/jonwayne/workspace/python-docs-samples/bigquery/cloud-client/env/lib/python3.4/site-packages/gcloud/bigquery/client.py", line 119, in job_from_resource
config = resource['configuration']
KeyError: 'configuration'
Inspection of the response from the initial upload request reveals the problem:
status: 400
body:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Empty schema specified for the load job. Please specify a schema that describes the data being loaded.",
...
It seems we should check the response before constructing the job.
If you try to add data to a table from a file without a schema:
This will fail with an opaque error:
Inspection of the response from the initial upload request reveals the problem:
It seems we should check the response before constructing the job.