Repository: modin-project/modin

Issue:
BUG: TypeError: argument of type 'PosixPath' is not iterable in read_parquet
```python
from pathlib import Path

p = Path("parquet_dir")
files = list(p.glob("**/*.parquet"))
df = pd.concat([pd.read_parquet(f) for f in files[:1]])
```

```python
Traceback (most recent call last):
  File "modin/modin/_compat/pandas_api/latest/io.py", line 229, in read_parquet
    query_compiler=FactoryDispatcher.read_parquet(
  File "modin/modin/core/execution/dispatching/factories/dispatcher.py", line 180, in read_parquet
    return cls.__factory._read_parquet(**kwargs)
  File "modin/modin/core/execution/dispatching/factories/factories.py", line 207, in _read_parquet
    return cls.io_cls.read_parquet(**kwargs)
  File "modin/modin/logging/logger_decorator.py", line 128, in run_and_log
    return obj(*args, **kwargs)
  File "modin/modin/core/io/file_dispatcher.py", line 154, in read
    query_compiler = cls._read(*args, **kwargs)
  File "modin/modin/logging/logger_decorator.py", line 128, in run_and_log
    return obj(*args, **kwargs)
  File "modin/modin/core/io/column_stores/parquet_dispatcher.py", line 632, in _read
    dataset = cls.get_dataset(path, engine, kwargs.get("storage_options") or {})
  File "modin/modin/logging/logger_decorator.py", line 128, in run_and_log
    return obj(*args, **kwargs)
  File "modin/modin/core/io/column_stores/parquet_dispatcher.py", line 319, in get_dataset
    return engine_class(path, storage_options)
  File "modin/modin/core/io/column_stores/parquet_dispatcher.py", line 67, in __init__
    self.dataset = self._init_dataset()
  File "modin/modin/core/io/column_stores/parquet_dispatcher.py", line 184, in _init_dataset                                                                                 self.fs_path, filesystem=self.fs, use_legacy_dataset=False                                                                                                                                 File "modin/modin/core/io/column_stores/parquet_dispatcher.py", line 129, in fs_path                                                                                       self._fs, self._fs_path = url_to_fs(self.path, **self.storage_options)
  File "miniconda3/envs/modin/lib/python3.8/site-packages/fsspec/core.py", line 392, in url_to_fs
    chain = _un_chain(url, kwargs)
  File "miniconda3/envs/modin/lib/python3.8/site-packages/fsspec/core.py", line 346, in _un_chain
    if "::" in path
TypeError: argument of type 'PosixPath' is not iterable
```


Discussion:
https://github.com/modin-project/modin/pull/4807 is a possible culprit.

cc @pyrito 
My parquet changes are just the gift that keeps on giving. I am surprised that fsspec can't handle this case, but this is a good catch. I'll open up a PR for this. 

Resolving patch:
diff --git a/modin/core/io/column_stores/parquet_dispatcher.py b/modin/core/io/column_stores/parquet_dispatcher.py
--- a/modin/core/io/column_stores/parquet_dispatcher.py
+++ b/modin/core/io/column_stores/parquet_dispatcher.py
@@ -60,7 +60,7 @@ class ColumnStoreDataset:
     """
 
     def __init__(self, path, storage_options):  # noqa : PR01
-        self.path = path
+        self.path = path.__fspath__() if isinstance(path, os.PathLike) else path
         self.storage_options = storage_options
         self._fs_path = None
         self._fs = None


Test patch:
diff --git a/modin/pandas/test/test_io.py b/modin/pandas/test/test_io.py
--- a/modin/pandas/test/test_io.py
+++ b/modin/pandas/test/test_io.py
@@ -1347,12 +1347,15 @@ class TestParquet:
     @pytest.mark.parametrize("columns", [None, ["col1"]])
     @pytest.mark.parametrize("row_group_size", [None, 100, 1000, 10_000])
     @pytest.mark.parametrize("engine", ["auto", "pyarrow", "fastparquet"])
+    @pytest.mark.parametrize("path_type", [Path, str])
     @pytest.mark.xfail(
         condition="config.getoption('--simulate-cloud').lower() != 'off'",
         reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
     )
-    def test_read_parquet(self, make_parquet_file, columns, row_group_size, engine):
-        unique_filename = get_unique_filename(extension="parquet")
+    def test_read_parquet(
+        self, make_parquet_file, columns, row_group_size, engine, path_type
+    ):
+        unique_filename = path_type(get_unique_filename(extension="parquet"))
         make_parquet_file(filename=unique_filename, row_group_size=row_group_size)
 
         eval_io(