-
Notifications
You must be signed in to change notification settings - Fork 323
Closed
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.Issues related to the googleapis/python-bigquery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
I expected this code to work:
@pytest.fixture(scope="session", autouse=True)
def cleanup_datasets(bigquery_client: bigquery.Client):
for dataset in bigquery_client.list_datasets():
if prefixer.should_cleanup(dataset.dataset_id):
bigquery_client.delete_dataset(
> dataset, delete_contents=True, not_found_ok=True
)
But I get
if not isinstance(dataset, (Dataset, DatasetReference)):
> raise TypeError("dataset must be a Dataset or a DatasetReference")
E TypeError: dataset must be a Dataset or a DatasetReference
/opt/conda/envs/test-environment/lib/python3.7/site-packages/google/cloud/bigquery/client.py:740: TypeError
Similarly, we should check delete_table
. I think it accepts TableListItem
, but this is not reflected in the type annotations.
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.Issues related to the googleapis/python-bigquery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.