@@ -483,47 +483,6 @@ def test_write_pandas_use_logical_type(
483483 cnx .execute_string (drop_sql )
484484
485485
486- @pytest .mark .parametrize (
487- ("use_vectorized_scanner" , "expected_file_format" ),
488- [
489- (None , "FILE_FORMAT=(TYPE=PARQUET COMPRESSION=auto)" ),
490- (True , "FILE_FORMAT=(TYPE=PARQUET COMPRESSION=auto USE_VECTORIZED_SCANNER=TRUE)" ),
491- (False , "FILE_FORMAT=(TYPE=PARQUET COMPRESSION=auto USE_VECTORIZED_SCANNER=FALSE)" ),
492- ],
493- )
494- def test_write_pandas_use_vectorized_scanner (
495- conn_cnx : Callable [..., Generator [SnowflakeConnection , None , None ]],
496- use_vectorized_scanner : bool | None ,
497- expected_file_format : str ,
498- ):
499- """Test that use_vectorized_scanner is making correct arguments to the COPY INTO command in SQL."""
500- from snowflake .connector .cursor import SnowflakeCursor
501-
502- table_name = random_string (5 , "use_vectorized_scanner" )
503-
504- with conn_cnx () as cnx :
505- def mocked_execute (* args , ** kwargs ):
506- if len (args ) >= 1 and args [0 ].startswith ("COPY INTO" ):
507- assert expected_file_format in args [0 ]
508- cur = SnowflakeCursor (cnx )
509- cur ._result = iter ([])
510- return cur
511-
512- with mock .patch (
513- "snowflake.connector.cursor.SnowflakeCursor.execute" ,
514- side_effect = mocked_execute ,
515- ) as m_execute :
516- success , nchunks , nrows , _ = write_pandas (
517- cnx ,
518- sf_connector_version_df .get (),
519- table_name = table_name ,
520- use_vectorized_scanner = use_vectorized_scanner ,
521- )
522- assert m_execute .called and any (
523- map (lambda e : "COPY INTO" in str (e [0 ]), m_execute .call_args_list )
524- )
525-
526-
527486def test_invalid_table_type_write_pandas (
528487 conn_cnx : Callable [..., Generator [SnowflakeConnection ]],
529488):
0 commit comments