Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/appveyor-cpp-setup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ if "%JOB%" NEQ "Build_Debug" (
"ninja" ^
"nomkl" ^
"pandas" ^
"fsspec" ^
"python=%PYTHON%" ^
|| exit /B
)
Expand Down
4 changes: 0 additions & 4 deletions python/pyarrow/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,6 @@ def _ensure_filesystem(fs):
for mro in inspect.getmro(fs_type):
if mro.__name__ == 'S3FileSystem':
return S3FSWrapper(fs)
# In case its a simple LocalFileSystem (e.g. dask) use native arrow
# FS
elif mro.__name__ == 'LocalFileSystem':
return LocalFileSystem._get_instance()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason this now gives troubles (while this code was already there for more than 2 years), is because with pyarrow >= 2.0, fsspec will no longer inherit from pyarrow.filesystem.FileSystem, and so this path was only taken if the passed filesystem was not a pyarrow subclass (so before, in pyarrow.fs, we simply didn't take this code path for fsspec filesystems)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine to simply remove this code, as in practice this was also never run anymore with previous pyarrow releases. I suppose this was only ever reached with old fsspec versions that did not yet subclass pyarrow.


if "fsspec" in sys.modules:
fsspec = sys.modules["fsspec"]
Expand Down
16 changes: 16 additions & 0 deletions python/pyarrow/tests/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -4339,3 +4339,19 @@ def test_parquet_dataset_new_filesystem(tempdir):
dataset = pq.ParquetDataset('.', filesystem=filesystem)
result = dataset.read()
assert result.equals(table)


def test_parquet_dataset_partitions_piece_path_with_fsspec(tempdir):
# ARROW-10462 ensure that on Windows we properly use posix-style paths
# as used by fsspec
fsspec = pytest.importorskip("fsspec")
filesystem = fsspec.filesystem('file')
table = pa.table({'a': [1, 2, 3]})
pq.write_table(table, tempdir / 'data.parquet')

# pass a posix-style path (using "/" also on Windows)
path = str(tempdir).replace("\\", "/")
dataset = pq.ParquetDataset(path, filesystem=filesystem)
# ensure the piece path is also posix-style
expected = path + "/data.parquet"
assert dataset.pieces[0].path == expected