@@ -491,15 +491,14 @@ def test_partition_cols_supported(self, pa_ge_070, df_full):
491
491
assert len (dataset .partitions .partition_names ) == 2
492
492
assert dataset .partitions .partition_names == set (partition_cols )
493
493
494
- def test_ignore_partition_cols_lt_070 (self , pa_lt_070 , df_full ):
494
+ def test_partition_cols_not_supported_pa_lt_70 (self , pa_lt_070 , df_full ):
495
495
# GH #23283
496
496
partition_cols = ['bool' , 'int' ]
497
- pa = pa_lt_070
498
497
df = df_full
499
- with tm . ensure_clean_dir () as path :
500
- df . to_parquet ( path , partition_cols = partition_cols ,
501
- compression = None )
502
- pytest . raises ( ValueError )
498
+ with pytest . raises ( ValueError ) :
499
+ with tm . ensure_clean_dir () as path :
500
+ df . to_parquet ( path , partition_cols = partition_cols ,
501
+ compression = None )
503
502
504
503
505
504
class TestParquetFastParquet (Base ):
@@ -572,17 +571,21 @@ def test_partition_cols_supported(self, fp, df_full):
572
571
partition_cols = ['bool' , 'int' ]
573
572
df = df_full
574
573
with tm .ensure_clean_dir () as path :
575
- df .to_parquet (path , partition_cols = partition_cols ,
576
- compression = None )
574
+ df .to_parquet (path , engine = "fastparquet" ,
575
+ partition_cols = partition_cols , compression = None )
577
576
assert os .path .exists (path )
578
577
import fastparquet
579
578
actual_partition_cols = fastparquet .ParquetFile (path , False ).cats
580
579
assert len (actual_partition_cols ) == 2
581
580
582
- def test_partition_on_not_supported (self , fp , df_full ):
581
+ def test_partition_on_supported (self , fp , df_full ):
583
582
# GH #23283
584
583
partition_cols = ['bool' , 'int' ]
585
584
df = df_full
586
- with pytest .raises (ValueError ):
587
- df .to_parquet ("" , compression = None ,
588
- partition_on = partition_cols )
585
+ with tm .ensure_clean_dir () as path :
586
+ df .to_parquet (path , engine = "fastparquet" , compression = None ,
587
+ partition_on = partition_cols )
588
+ assert os .path .exists (path )
589
+ import fastparquet
590
+ actual_partition_cols = fastparquet .ParquetFile (path , False ).cats
591
+ assert len (actual_partition_cols ) == 2
0 commit comments