Allow a use_query_cache
override directly in create_engine
or execution_options
#1112
Labels
api: bigquery
Issues related to the googleapis/python-bigquery-sqlalchemy API.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Is your feature request related to a problem? Please describe.
If I want to execute a particular query that bypasses the BQ query cache, I have to instantiate a new client object, pass it the
QueryJobConfig
withuse_query_cache=False
, and then pass that client intocreate_engine
, like below:The main issue with this is that
create_engine
is slow for BigQuery compared to most other dialects, perhaps because ofoauth2
checking the credentials passed into the BQ client. It also means that calling code has to keep track of thejob_config
,bq_client
andbq_engine
objects.For these reasons I would rather pass a parameter, perhaps a
QueryJobConfig
object, and let the dialect and the DBAPI handle the client object.Describe the solution you'd like
I see that
BigQueryDialect
inherits fromDefaultDialect
and thatCursor.execute
in the BigQuery DBAPI repo does include a parameter forjob_config
. I wonder if it as easy as overridingdo_execute
in the dialect within this repo to pass along thatjob_config
?The caller could then use it like this:
Describe alternatives you've considered
See the pseudocode above. It works for us, but it's cumbersome and causes a performance hit.
The text was updated successfully, but these errors were encountered: