diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index a5033c51bce81..b7c8ca7e0c49f 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -3,6 +3,7 @@ from distutils.version import LooseVersion from io import BytesIO import os +import pathlib from warnings import catch_warnings import numpy as np @@ -663,6 +664,20 @@ def test_partition_cols_string(self, pa, df_full): assert len(dataset.partitions.partition_names) == 1 assert dataset.partitions.partition_names == set(partition_cols_list) + @pytest.mark.parametrize( + "path_type", [lambda path: path, lambda path: pathlib.Path(path)] + ) + def test_partition_cols_pathlib(self, pa, df_compat, path_type): + # GH 35902 + + partition_cols = "B" + partition_cols_list = [partition_cols] + df = df_compat + + with tm.ensure_clean_dir() as path_str: + path = path_type(path_str) + df.to_parquet(path, partition_cols=partition_cols_list) + def test_empty_dataframe(self, pa): # GH #27339 df = pd.DataFrame()