@@ -473,6 +473,18 @@ def test_partition_cols_supported(self, pa, df_full):
473
473
assert len (dataset .partitions .partition_names ) == 2
474
474
assert dataset .partitions .partition_names == set (partition_cols )
475
475
476
+ def test_partition_cols_string (self , pa , df_full ):
477
+ # GH #23283
478
+ partition_cols = 'bool'
479
+ df = df_full
480
+ with tm .ensure_clean_dir () as path :
481
+ df .to_parquet (path , partition_cols = partition_cols , compression = None )
482
+ import pyarrow .parquet as pq
483
+
484
+ dataset = pq .ParquetDataset (path , validate_schema = False )
485
+ assert len (dataset .partitions .partition_names ) == 1
486
+ assert dataset .partitions .partition_names == set ([partition_cols ])
487
+
476
488
def test_empty_dataframe (self , pa ):
477
489
# GH #27339
478
490
df = pd .DataFrame ()
@@ -543,6 +555,23 @@ def test_partition_cols_supported(self, fp, df_full):
543
555
actual_partition_cols = fastparquet .ParquetFile (path , False ).cats
544
556
assert len (actual_partition_cols ) == 2
545
557
558
+ def test_partition_cols_string (self , fp , df_full ):
559
+ # GH #23283
560
+ partition_cols = 'bool'
561
+ df = df_full
562
+ with tm .ensure_clean_dir () as path :
563
+ df .to_parquet (
564
+ path ,
565
+ engine = "fastparquet" ,
566
+ partition_cols = partition_cols ,
567
+ compression = None ,
568
+ )
569
+ assert os .path .exists (path )
570
+ import fastparquet # noqa: F811
571
+
572
+ actual_partition_cols = fastparquet .ParquetFile (path , False ).cats
573
+ assert len (actual_partition_cols ) == 1
574
+
546
575
def test_partition_on_supported (self , fp , df_full ):
547
576
# GH #23283
548
577
partition_cols = ["bool" , "int" ]
0 commit comments