Skip to content

Bigquery: Missing Entity Type when reading dataset.access_entries #9963

Description

@tanisharai

When running the following code:

fromgoogle.cloudimportbigquerygbq_client=bigquery.Client(project='project-name')
dataset_ref=gbq_client.dataset(dataset_id='dataset1', project='project-name')
dataset=gbq_client.get_dataset(dataset_ref=dataset_ref)
print(len(dataset.access_entries))

the following error will happen about 25% of the time:

Traceback (mostrecentcalllast):
File"iam.py", line5, in<module>print(len(dataset.access_entries))
File"/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/dataset.py", line376, inaccess_entriesreturn [AccessEntry.from_api_repr(entry) forentryinentries]
File"/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/dataset.py", line376, in<listcomp>return [AccessEntry.from_api_repr(entry) forentryinentries]
File"/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/dataset.py", line183, infrom_api_reprreturncls(role, entity_type, entity_id)
File"/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/dataset.py", line115, in__init__raiseValueError(message)
ValueError: Entitytype'iamMember'notamong: domain, groupByEmail, specialGroup, userByEmail, view

It seems the Google API is returning a new 'iamMember' entity type that is not in the hard coded list of allowed entity types in dataset.py

Metadata

Metadata

Labels

api: bigqueryIssues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions