Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

feat: list_tables accepts a DatasetListItem #588

Copy link
Copy link

Description

@tswast
Issue body actions

Is your feature request related to a problem? Please describe.

Code:

for dataset in bqclient.list_datasets():
    tables = list(bqclient.list_tables(dataset, max_results=1))
    if len(tables) == 0:
        bqclient.delete_dataset(dataset)

Output:

Traceback (most recent call last):
  File "2021/04-test-dataset-cleanup/cleanup.py", line 11, in <module>
    tables = len(bqclient.list_tables(dataset, max_results=1))
  File "/Users/swast/miniconda3/envs/scratch/lib/python3.8/site-packages/google/cloud/bigquery/client.py", line 1327, in list_tables
    raise TypeError("dataset must be a Dataset, DatasetReference, or string")
TypeError: dataset must be a Dataset, DatasetReference, or string

Describe the solution you'd like

Where Dataset or DatasetReference is accepted, also accept a DatasetListItem.

Describe alternatives you've considered

I know that we created DatasetListItem.reference, which I can use, but it'd be a bit more intuitive if I didn't have to.

Additional context

N/A

Reactions are currently unavailable

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.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.