@@ -198,6 +198,8 @@ def check_round_trip(
198198 repeat: int, optional
199199 How many times to repeat the test
200200 """
201+ if not isinstance (temp_file , pathlib .Path ):
202+ raise ValueError ("temp_file must be a pathlib.Path" )
201203 write_kwargs = write_kwargs or {"compression" : None }
202204 read_kwargs = read_kwargs or {}
203205
@@ -396,9 +398,11 @@ def test_columns_dtypes(self, engine, temp_file):
396398 check_round_trip (df , temp_file , engine )
397399
398400 @pytest .mark .parametrize ("compression" , [None , "gzip" , "snappy" , "brotli" ])
399- def test_compression (self , engine , compression ):
401+ def test_compression (self , engine , compression , temp_file ):
400402 df = pd .DataFrame ({"A" : [1 , 2 , 3 ]})
401- check_round_trip (df , engine , write_kwargs = {"compression" : compression })
403+ check_round_trip (
404+ df , temp_file , engine , write_kwargs = {"compression" : compression }
405+ )
402406
403407 def test_read_columns (self , engine , temp_file ):
404408 # GH18154
@@ -424,8 +428,8 @@ def test_read_filters(self, engine, tmp_path):
424428 expected = pd .DataFrame ({"int" : [0 , 1 ]})
425429 check_round_trip (
426430 df ,
431+ tmp_path ,
427432 engine ,
428- path = tmp_path ,
429433 expected = expected ,
430434 write_kwargs = {"partition_cols" : ["part" ]},
431435 read_kwargs = {"filters" : [("part" , "==" , "a" )], "columns" : ["int" ]},
0 commit comments