@@ -385,23 +385,25 @@ def run_query(self, query, **kwargs):
385
385
_check_google_client_version ()
386
386
387
387
job_collection = self .service .jobs ()
388
- job_data = {
389
- 'configuration' : {
390
- 'query' : {
391
- 'query' : query ,
392
- 'useLegacySql' : self .dialect == 'legacy'
393
- # 'allowLargeResults', 'createDisposition',
394
- # 'preserveNulls', destinationTable, useQueryCache
395
- }
388
+
389
+ job_config = {
390
+ 'query' : {
391
+ 'query' : query ,
392
+ 'useLegacySql' : self .dialect == 'legacy'
393
+ # 'allowLargeResults', 'createDisposition',
394
+ # 'preserveNulls', destinationTable, useQueryCache
396
395
}
397
396
}
398
397
configuration = kwargs .get ('configuration' )
399
398
if configuration is not None :
400
399
if 'query' in configuration :
401
- job_data ['configuration' ]['query' ]\
402
- .update (configuration ['query' ])
400
+ job_config ['query' ].update (configuration ['query' ])
403
401
else :
404
- job_data ['configuration' ] = configuration
402
+ job_config = configuration
403
+
404
+ job_data = {
405
+ 'configuration' : job_config
406
+ }
405
407
406
408
self ._start_timer ()
407
409
try :
@@ -692,6 +694,8 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None,
692
694
693
695
**kwargs: Arbitrary keyword arguments
694
696
configuration (dict): query config parameters for job processing.
697
+ For example:
698
+ configuration = {'query': {'useQueryCache': False}}
695
699
For more information see `BigQuery SQL Reference
696
700
<https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query>`
697
701
0 commit comments