@@ -63,9 +63,7 @@ def assert_result_equals(
63
63
assert set (cnx .cursor ().execute (sql ).fetchall ()) == set (expected_data )
64
64
65
65
66
- def test_fix_snow_746341 (
67
- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]]
68
- ):
66
+ def test_fix_snow_746341 (conn_cnx : Callable [..., Generator [SnowflakeConnection ]]):
69
67
cat = '"cat"'
70
68
df = pandas .DataFrame ([[1 ], [2 ]], columns = [f"col_'{ cat } '" ])
71
69
table_name = random_string (5 , "snow746341_" )
@@ -83,7 +81,7 @@ def test_fix_snow_746341(
83
81
@pytest .mark .parametrize ("auto_create_table" , [True , False ])
84
82
@pytest .mark .parametrize ("index" , [False ])
85
83
def test_write_pandas_with_overwrite (
86
- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]],
84
+ conn_cnx : Callable [..., Generator [SnowflakeConnection ]],
87
85
quote_identifiers : bool ,
88
86
auto_create_table : bool ,
89
87
index : bool ,
@@ -225,7 +223,7 @@ def test_write_pandas_with_overwrite(
225
223
@pytest .mark .parametrize ("create_temp_table" , [True , False ])
226
224
@pytest .mark .parametrize ("index" , [False ])
227
225
def test_write_pandas (
228
- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]],
226
+ conn_cnx : Callable [..., Generator [SnowflakeConnection ]],
229
227
db_parameters : dict [str , str ],
230
228
compression : str ,
231
229
chunk_size : int ,
@@ -296,7 +294,7 @@ def test_write_pandas(
296
294
297
295
298
296
def test_write_non_range_index_pandas (
299
- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]],
297
+ conn_cnx : Callable [..., Generator [SnowflakeConnection ]],
300
298
db_parameters : dict [str , str ],
301
299
):
302
300
compression = "gzip"
@@ -376,7 +374,7 @@ def test_write_non_range_index_pandas(
376
374
377
375
@pytest .mark .parametrize ("table_type" , ["" , "temp" , "temporary" , "transient" ])
378
376
def test_write_pandas_table_type (
379
- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]],
377
+ conn_cnx : Callable [..., Generator [SnowflakeConnection ]],
380
378
table_type : str ,
381
379
):
382
380
with conn_cnx () as cnx :
@@ -408,7 +406,7 @@ def test_write_pandas_table_type(
408
406
409
407
410
408
def test_write_pandas_create_temp_table_deprecation_warning (
411
- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]],
409
+ conn_cnx : Callable [..., Generator [SnowflakeConnection ]],
412
410
):
413
411
with conn_cnx () as cnx :
414
412
table_name = random_string (5 , "driver_versions_" )
@@ -436,7 +434,7 @@ def test_write_pandas_create_temp_table_deprecation_warning(
436
434
437
435
@pytest .mark .parametrize ("use_logical_type" , [None , True , False ])
438
436
def test_write_pandas_use_logical_type (
439
- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]],
437
+ conn_cnx : Callable [..., Generator [SnowflakeConnection ]],
440
438
use_logical_type : bool | None ,
441
439
):
442
440
table_name = random_string (5 , "USE_LOCAL_TYPE_" ).upper ()
@@ -483,7 +481,7 @@ def test_write_pandas_use_logical_type(
483
481
484
482
485
483
def test_invalid_table_type_write_pandas (
486
- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]],
484
+ conn_cnx : Callable [..., Generator [SnowflakeConnection ]],
487
485
):
488
486
with conn_cnx () as cnx :
489
487
with pytest .raises (ValueError , match = "Unsupported table type" ):
@@ -496,7 +494,7 @@ def test_invalid_table_type_write_pandas(
496
494
497
495
498
496
def test_empty_dataframe_write_pandas (
499
- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]],
497
+ conn_cnx : Callable [..., Generator [SnowflakeConnection ]],
500
498
):
501
499
table_name = random_string (5 , "empty_dataframe_" )
502
500
df = pandas .DataFrame ([], columns = ["name" , "balance" ])
@@ -720,7 +718,7 @@ def mocked_execute(*args, **kwargs):
720
718
721
719
@pytest .mark .parametrize ("quote_identifiers" , [True , False ])
722
720
def test_default_value_insertion (
723
- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]],
721
+ conn_cnx : Callable [..., Generator [SnowflakeConnection ]],
724
722
quote_identifiers : bool ,
725
723
):
726
724
"""Tests whether default values can be successfully inserted with the pandas writeback."""
@@ -774,7 +772,7 @@ def test_default_value_insertion(
774
772
775
773
@pytest .mark .parametrize ("quote_identifiers" , [True , False ])
776
774
def test_autoincrement_insertion (
777
- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]],
775
+ conn_cnx : Callable [..., Generator [SnowflakeConnection ]],
778
776
quote_identifiers : bool ,
779
777
):
780
778
"""Tests whether default values can be successfully inserted with the pandas writeback."""
@@ -828,7 +826,7 @@ def test_autoincrement_insertion(
828
826
],
829
827
)
830
828
def test_special_name_quoting (
831
- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]],
829
+ conn_cnx : Callable [..., Generator [SnowflakeConnection ]],
832
830
auto_create_table : bool ,
833
831
column_names : list [str ],
834
832
):
@@ -875,7 +873,7 @@ def test_special_name_quoting(
875
873
876
874
877
875
def test_auto_create_table_similar_column_names (
878
- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]],
876
+ conn_cnx : Callable [..., Generator [SnowflakeConnection ]],
879
877
):
880
878
"""Tests whether similar names do not cause issues when auto-creating a table as expected."""
881
879
table_name = random_string (5 , "numbas_" )
@@ -905,9 +903,7 @@ def test_auto_create_table_similar_column_names(
905
903
cnx .execute_string (drop_sql )
906
904
907
905
908
- def test_all_pandas_types (
909
- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]]
910
- ):
906
+ def test_all_pandas_types (conn_cnx : Callable [..., Generator [SnowflakeConnection ]]):
911
907
table_name = random_string (5 , "all_types_" )
912
908
datetime_with_tz = datetime (1997 , 6 , 3 , 14 , 21 , 32 , 00 , tzinfo = timezone .utc )
913
909
datetime_with_ntz = datetime (1997 , 6 , 3 , 14 , 21 , 32 , 00 )
@@ -979,7 +975,7 @@ def test_all_pandas_types(
979
975
980
976
@pytest .mark .parametrize ("object_type" , ["STAGE" , "FILE FORMAT" ])
981
977
def test_no_create_internal_object_privilege_in_target_schema (
982
- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]],
978
+ conn_cnx : Callable [..., Generator [SnowflakeConnection ]],
983
979
caplog ,
984
980
object_type ,
985
981
):
0 commit comments