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

Allow enabling/disabling the storage API on a per-connection basis #1920

Open
gallodustin opened this issue May 15, 2024 · 2 comments · May be fixed by #1945
Open

Allow enabling/disabling the storage API on a per-connection basis #1920

gallodustin opened this issue May 15, 2024 · 2 comments · May be fixed by #1945
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@gallodustin
Copy link

In #16, support was added for the BigQuery storage API in the form of a bqstorage_client which is passed to or created by connect(). Yet there is no way, other than installing or uninstalling the storage API itself, to toggle whether the storage API is enabled/disabled.

Since use of the storage API does affect pricing, it would be preferable to enable or disable on a per-connection basis, perhaps as a use_storage_api: bool parameter on connect(). This way, callers could choose at will whether to use the storage API without having to change the Python environment the code is running in.

As a hack to workaround this issue, I attempted calling connect passing a normal Client object rather than a BigQueryReadClient in the bqstorage_client parameter, but this does not create a functioning usable connection.

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label May 15, 2024
@Linchin Linchin added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p3 Desirable enhancement or fix. May not be included in next release. labels May 20, 2024
@tswast
Copy link
Contributor

tswast commented May 21, 2024

Since use of the storage API does affect pricing,

Not really true when we're talking about query results. My understanding is that BQ Storage Reads are free from anonymous query result tables.

@tswast
Copy link
Contributor

tswast commented May 21, 2024

That said, there could be other reasons not to use this. In to_dataframe, one can set create_bqstorage_client=False to disable the automatic behavior, for example.

@Linchin Linchin assigned Linchin and unassigned shollyman Jun 4, 2024
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 API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants