@@ -297,33 +297,24 @@ def set_connection(self):
297
297
else :
298
298
raise DataDiffDbtSnowflakeSetConnectionError ("Snowflake: unsupported auth method" )
299
299
elif conn_type == "bigquery" :
300
- supported_methods = {
301
- "oauth" : {
302
- "conn_info" : {
303
- "driver" : conn_type ,
304
- "project" : credentials .get ("project" ),
305
- "dataset" : credentials .get ("dataset" ),
306
- }
307
- },
308
- "service-account" : {
309
- "conn_info" : {
310
- "driver" : conn_type ,
311
- "project" : credentials .get ("project" ),
312
- "dataset" : credentials .get ("dataset" ),
313
- "keyfile" : credentials .get ("keyfile" ),
314
- }
315
- },
316
- }
300
+ supported_methods = ["oauth" , "service-account" ]
317
301
method = credentials .get ("method" )
318
302
# there are many connection types https://docs.getdbt.com/reference/warehouse-setups/bigquery-setup#oauth-via-gcloud
319
303
# this assumes that the user is auth'd via `gcloud auth application-default login`
320
304
if method not in supported_methods :
321
305
raise DataDiffDbtBigQueryUnsupportedMethodError (
322
- f"Method: { method } is not in the current methods supported for Big Query ({ supported_methods . keys () } )."
306
+ f"Method: { method } is not in the current methods supported for Big Query ({ supported_methods } )."
323
307
)
324
308
325
- conn_info = supported_methods [method ]["conn_info" ]
309
+ conn_info = {
310
+ "driver" : conn_type ,
311
+ "project" : credentials .get ("project" ),
312
+ "dataset" : credentials .get ("dataset" ),
313
+ }
314
+
326
315
self .threads = credentials .get ("threads" )
316
+ if method == supported_methods [1 ]:
317
+ conn_info ["keyfile" ] = credentials .get ("keyfile" )
327
318
328
319
elif conn_type == "duckdb" :
329
320
conn_info = {
0 commit comments