googleapis/python-bigquery-dataframes

Possible to use read_gbq() without bigquery.readsessions.create permissions?

chrisperks opened this issue · 2 comments

Hi!

I'm using bigframes 0.19.2 and in particular, using pandas.read_gbq(..) to read an SQL statement to a Pandas DataFrame.

I don't have permissions to create a ReadSession on our BigQuery instance, so my query fails, reporting I don't have the relevant bigquery.readsessions.create permissions.

When using the regular BigQuery client, I can set the option create_bqstorage_client=False to get around this lack of permissions.

Can I use read_gbq in any similar way, or otherwise set options to remove the need for bigquery.readsessions.create permissions?

Thanks.
Chris.

tswast commented

Thanks for the feedback @chrisperks. At the moment it is not possible to avoid using the BigQuery Storage Read API in BigQuery DataFrames to_pandas and other methods that could download data in bulk like __repr__ or .values.

Performance won't be ideal without the BQ Storage API, but it should be possible, as you have noted the BQ client library does support this.

I propose we add global use_bqstorage_read_api=True|False option to https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes._config.bigquery_options.BigQueryOptions to avoid the BQ Storage API in I/O.

Thanks for the feedback!