Skip to content

BigQuery client.list_datasets() fails when the project has no datasets #1424

@dhermes

Description

@dhermes

Found while doing clean-up of a project after reproducing #1419

Reproduce:

In [11]: client.list_datasets() --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-11-fed4650eba20> in <module>() ----> 1 client.list_datasets() gcloud-python/gcloud/bigquery/client.pyc in list_datasets(self, include_all, max_results, page_token) 89 query_params=params) 90 datasets = [Dataset.from_api_repr(resource, self) ---> 91 for resource in resp['datasets']] 92 return datasets, resp.get('nextPageToken') 93 KeyError: 'datasets'``

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