Skip to content

BigQuery: list_jobs() iterator encounters error when calling classmethod from_api_repr() #2882

@sean185

Description

@sean185

Disclaimer: I am new to opening issues so please guide me along on what I can do to improve, thanks.

  1. Ubuntu 14.04

  2. Python 2.7.6

  3. google-cloud-python version

google-api-python-client==1.5.5
google-auth==0.4.0
google-auth-httplib2==0.0.2
google-cloud-bigquery==0.22.0
google-cloud-core==0.22.0
googleapis-common-protos==1.5.0
  1. Stacktrace if available
Traceback (most recent call last):
  File "pybq_test.py", line 103, in <module>
    main()
  File "pybq_test.py", line 69, in main
    for i,job in enumerate(jobs):
  File "/home/dev-sean/BQTesting/local/lib/python2.7/site-packages/google/cloud/iterator.py", line 211, in _items_iter
    for item in page:
  File "/home/dev-sean/BQTesting/local/lib/python2.7/site-packages/google/cloud/iterator.py", line 155, in next
    result = self._item_to_value(self._parent, item)
  File "/home/dev-sean/BQTesting/local/lib/python2.7/site-packages/google/cloud/bigquery/client.py", line 382, in _item_to_job
    return iterator.client.job_from_resource(resource)
  File "/home/dev-sean/BQTesting/local/lib/python2.7/site-packages/google/cloud/bigquery/client.py", line 165, in job_from_resource
    return CopyJob.from_api_repr(resource, self)
  File "/home/dev-sean/BQTesting/local/lib/python2.7/site-packages/google/cloud/bigquery/job.py", line 745, in from_api_repr
    for source_config in config['sourceTables']:
KeyError: 'sourceTables'
  1. Steps to reproduce
  • instantiate the list_jobs iterator with parameter all_users=True
  • iterate through the jobs
  • as it iterates the error is produced when converting response from_api_repr
  1. Code example
jobs = bqClient.list_jobs(all_users=True)
for i,job in enumerate(jobs):
    print job.name

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions