@@ -170,7 +170,7 @@ def test_create_ds_config(self, config: TDsConfig):
170170
171171 @patch ("data_diff.dbt_parser.DbtParser.__new__" )
172172 def test_create_snowflake_ds_config_from_dbt_profiles (self , mock_dbt_parser ):
173- config = DATA_SOURCE_CONFIGS [' snowflake' ]
173+ config = DATA_SOURCE_CONFIGS [" snowflake" ]
174174 mock_dbt_parser .get_connection_creds .return_value = (config .options ,)
175175 with patch ("rich.prompt.Console.input" , side_effect = ["y" , config .temp_schema , str (config .float_tolerance )]):
176176 actual_config = create_ds_config (
@@ -182,7 +182,7 @@ def test_create_snowflake_ds_config_from_dbt_profiles(self, mock_dbt_parser):
182182
183183 @patch ("data_diff.dbt_parser.DbtParser.__new__" )
184184 def test_create_bigquery_ds_config_dbt_oauth (self , mock_dbt_parser ):
185- config = DATA_SOURCE_CONFIGS [' bigquery' ]
185+ config = DATA_SOURCE_CONFIGS [" bigquery" ]
186186 mock_dbt_parser .get_connection_creds .return_value = (config .options ,)
187187 with patch ("rich.prompt.Console.input" , side_effect = ["y" , config .temp_schema , str (config .float_tolerance )]):
188188 actual_config = create_ds_config (
@@ -195,18 +195,23 @@ def test_create_bigquery_ds_config_dbt_oauth(self, mock_dbt_parser):
195195 @patch ("data_diff.dbt_parser.DbtParser.__new__" )
196196 @patch ("data_diff.cloud.data_source._get_data_from_bigquery_json" )
197197 def test_create_bigquery_ds_config_dbt_service_account (self , mock_get_data_from_bigquery_json , mock_dbt_parser ):
198- config = DATA_SOURCE_CONFIGS ['bigquery' ]
199-
200- mock_get_data_from_bigquery_json .return_value = json .loads (config .options ['jsonKeyFile' ])
201- mock_dbt_parser .get_connection_creds .return_value = {
202- 'type' : 'bigquery' ,
203- 'method' : 'service-account' ,
204- 'project' : config .options ['projectId' ],
205- 'threads' : 1 ,
206- 'keyfile' : '/some/path'
207- },
198+ config = DATA_SOURCE_CONFIGS ["bigquery" ]
199+
200+ mock_get_data_from_bigquery_json .return_value = json .loads (config .options ["jsonKeyFile" ])
201+ mock_dbt_parser .get_connection_creds .return_value = (
202+ {
203+ "type" : "bigquery" ,
204+ "method" : "service-account" ,
205+ "project" : config .options ["projectId" ],
206+ "threads" : 1 ,
207+ "keyfile" : "/some/path" ,
208+ },
209+ )
208210
209- with patch ("rich.prompt.Console.input" , side_effect = ["y" , config .options ['location' ], config .temp_schema , str (config .float_tolerance )]):
211+ with patch (
212+ "rich.prompt.Console.input" ,
213+ side_effect = ["y" , config .options ["location" ], config .temp_schema , str (config .float_tolerance )],
214+ ):
210215 actual_config = create_ds_config (
211216 ds_config = self .db_type_data_source_schemas [config .type ],
212217 data_source_name = config .name ,
@@ -216,17 +221,22 @@ def test_create_bigquery_ds_config_dbt_service_account(self, mock_get_data_from_
216221
217222 @patch ("data_diff.dbt_parser.DbtParser.__new__" )
218223 def test_create_bigquery_ds_config_dbt_service_account_json (self , mock_dbt_parser ):
219- config = DATA_SOURCE_CONFIGS ['bigquery' ]
220-
221- mock_dbt_parser .get_connection_creds .return_value = {
222- 'type' : 'bigquery' ,
223- 'method' : 'service-account-json' ,
224- 'project' : config .options ['projectId' ],
225- 'threads' : 1 ,
226- 'keyfile_json' : json .loads (config .options ['jsonKeyFile' ])
227- },
224+ config = DATA_SOURCE_CONFIGS ["bigquery" ]
225+
226+ mock_dbt_parser .get_connection_creds .return_value = (
227+ {
228+ "type" : "bigquery" ,
229+ "method" : "service-account-json" ,
230+ "project" : config .options ["projectId" ],
231+ "threads" : 1 ,
232+ "keyfile_json" : json .loads (config .options ["jsonKeyFile" ]),
233+ },
234+ )
228235
229- with patch ("rich.prompt.Console.input" , side_effect = ["y" , config .options ['location' ], config .temp_schema , str (config .float_tolerance )]):
236+ with patch (
237+ "rich.prompt.Console.input" ,
238+ side_effect = ["y" , config .options ["location" ], config .temp_schema , str (config .float_tolerance )],
239+ ):
230240 actual_config = create_ds_config (
231241 ds_config = self .db_type_data_source_schemas [config .type ],
232242 data_source_name = config .name ,
@@ -236,10 +246,12 @@ def test_create_bigquery_ds_config_dbt_service_account_json(self, mock_dbt_parse
236246
237247 @patch ("sys.stdout" , new_callable = StringIO )
238248 @patch ("data_diff.dbt_parser.DbtParser.__new__" )
239- def test_create_ds_snowflake_config_from_dbt_profiles_one_param_passed_through_input (self , mock_dbt_parser , mock_stdout ):
240- config = DATA_SOURCE_CONFIGS ['snowflake' ]
241- options = {** config .options , 'type' : 'snowflake' }
242- options ['database' ] = options .pop ('default_db' )
249+ def test_create_ds_snowflake_config_from_dbt_profiles_one_param_passed_through_input (
250+ self , mock_dbt_parser , mock_stdout
251+ ):
252+ config = DATA_SOURCE_CONFIGS ["snowflake" ]
253+ options = {** config .options , "type" : "snowflake" }
254+ options ["database" ] = options .pop ("default_db" )
243255 account = options .pop ("account" )
244256 mock_dbt_parser .get_connection_creds .return_value = (options ,)
245257 with patch (
0 commit comments