8000 Bigquery: Missing Entity Type when reading dataset.access_entries · Issue #9963 · googleapis/google-cloud-python · GitHub
[go: up one dir, main page]

Skip to content

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

@tanisharai

Description

@tanisharai

When running the following code:

from google.cloud import bigquery
gbq_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 (most recent call last):
  File "iam.py", line 5, in <module>
    print(len(dataset.access_entries))
  File "/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/dataset.py", line 376, in access_entries
    return [AccessEntry.from_api_repr(entry) for entry in entries]
  File "/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/dataset.py", line 376, in <listcomp>
    return [AccessEntry.from_api_repr(entry) for entry in entries]
  File "/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/dataset.py", line 183, in from_api_repr
    return cls(role, entity_type, entity_id)
  File "/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/dataset.py", line 115, in __init__
    raise ValueError(message)
ValueError: Entity type 'iamMember' not among: 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

    0