Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify default dataset when invoking read_gbq #474

Open
rjrudin opened this issue Jan 24, 2022 · 2 comments
Open

Specify default dataset when invoking read_gbq #474

rjrudin opened this issue Jan 24, 2022 · 2 comments
Labels
api: bigquery Issues related to the googleapis/python-bigquery-pandas API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@rjrudin
Copy link

rjrudin commented Jan 24, 2022

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

We're currently using SqlAlchemy to read data from BQ. I've tested read_gbq, and it's roughly an order of magnitude faster. So we definitely want to switch, but we ran into one issue. When using SqlAlchemy, we can specify a default dataset when constructing an engine, and our SQL queries of course can then leverage that. I can't find a way to specify a default dataset when using read_gbq, which means we need to rework how we construct our SQL queries.

Describe the solution you'd like

I'm hoping that read_gbq could eventually support a "dataset" property and use that in the same way that SqlAlchemy does when we construct an engine.

Describe alternatives you've considered

Our alternative is to rework how we generate SQL queries so that they do not assume that a default dataset has been set.

Additional context

Lack of a "dataset" argument is not a deal breaker, it just seems like something that I'd expect to exist given that BQ offers the concept of a default dataset.

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-pandas API. label Jan 24, 2022
@tswast tswast added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Jan 24, 2022
@tswast
Copy link
Collaborator

tswast commented Jan 24, 2022

This is a reasonable feature request. There is already some default info provided via the "context" variable. It should be possible to add this there if it's not there already.

@aribray
Copy link
Contributor

aribray commented Jan 13, 2023

In the meantime, you can specify a default dataset using the read_gbq() configuration argument. See the reference for QueryJobConfig's default_dataset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-pandas API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants