@@ -81,7 +81,9 @@ def test_create_materialized_view(make_mocked_engine_adapter: t.Callable[..., Do
8181 target_columns_to_types = {"a" : exp .DataType .build ("INT" ), "b" : exp .DataType .build ("INT" )},
8282 column_descriptions = {"a" : "test_column_description" , "b" : "test_column_description" },
8383 )
84- adapter .create_view ("test_view" , parse_one ("SELECT a, b FROM tbl" ), replace = False , materialized = True )
84+ adapter .create_view (
85+ "test_view" , parse_one ("SELECT a, b FROM tbl" ), replace = False , materialized = True
86+ )
8587
8688 assert to_sql_calls (adapter ) == [
8789 "CREATE MATERIALIZED VIEW `test_view` (`a` COMMENT 'test_column_description', `b` COMMENT 'test_column_description') AS SELECT `a`, `b` FROM `tbl`" ,
@@ -160,7 +162,9 @@ def test_rename_table(make_mocked_engine_adapter: t.Callable[..., DorisEngineAda
160162 adapter .cursor .execute .assert_called_once_with ("ALTER TABLE `old_table` RENAME `new_table`" )
161163
162164
163- def test_replace_by_key (make_mocked_engine_adapter : t .Callable [..., DorisEngineAdapter ], mocker : MockerFixture ):
165+ def test_replace_by_key (
166+ make_mocked_engine_adapter : t .Callable [..., DorisEngineAdapter ], mocker : MockerFixture
167+ ):
164168 adapter = make_mocked_engine_adapter (DorisEngineAdapter )
165169 temp_table = parse_one ("temp_table" )
166170 mocker .patch .object (adapter , "_get_temp_table" , return_value = temp_table )
@@ -174,8 +178,12 @@ def test_replace_by_key(make_mocked_engine_adapter: t.Callable[..., DorisEngineA
174178
175179 adapter ._replace_by_key (target_table , source_query , columns_to_types , [exp .column ("a" )], True )
176180 adapter ._replace_by_key (target_table , source_query , columns_to_types , [exp .column ("a" )], False )
177- adapter ._replace_by_key (target_table , source_query , columns_to_types , [exp .column ("a" ), exp .column ("b" )], True )
178- adapter ._replace_by_key (target_table , source_query , columns_to_types , [exp .column ("a" ), exp .column ("b" )], False )
181+ adapter ._replace_by_key (
182+ target_table , source_query , columns_to_types , [exp .column ("a" ), exp .column ("b" )], True
183+ )
184+ adapter ._replace_by_key (
185+ target_table , source_query , columns_to_types , [exp .column ("a" ), exp .column ("b" )], False
186+ )
179187
180188 assert to_sql_calls (adapter , identify = True ) == [
181189 "INSERT INTO `target_table` (`a`, `b`) SELECT `a`, `b` FROM (SELECT `a` AS `a`, `b` AS `b`, ROW_NUMBER() OVER (PARTITION BY `a` ORDER BY `a`) AS _row_number FROM `temp_table`) AS _t WHERE _row_number = 1" ,
@@ -189,7 +197,9 @@ def test_create_index(make_mocked_engine_adapter: t.Callable[..., DorisEngineAda
189197 adapter = make_mocked_engine_adapter (DorisEngineAdapter )
190198
191199 adapter .create_index ("test_table" , "test_index" , ("cola" ,))
192- adapter .cursor .execute .assert_called_once_with ("CREATE INDEX IF NOT EXISTS `test_index` ON `test_table`(`cola`)" )
200+ adapter .cursor .execute .assert_called_once_with (
201+ "CREATE INDEX IF NOT EXISTS `test_index` ON `test_table`(`cola`)"
202+ )
193203
194204
195205def test_create_table_with_distributed_by (
@@ -271,7 +281,11 @@ def test_create_table_with_partitioned_by(
271281 "test_table" ,
272282 target_columns_to_types = {"a" : exp .DataType .build ("INT" ), "b" : exp .DataType .build ("DATE" )},
273283 partitioned_by = [exp .to_column ("b" )],
274- table_properties = {"partitions" : exp .Literal .string ("FROM ('2000-11-14') TO ('2021-11-14') INTERVAL 2 YEAR" )},
284+ table_properties = {
285+ "partitions" : exp .Literal .string (
286+ "FROM ('2000-11-14') TO ('2021-11-14') INTERVAL 2 YEAR"
287+ )
288+ },
275289 )
276290
277291 assert to_sql_calls (adapter ) == [
0 commit comments