MCPcopy Create free account
hub / github.com/apache/arrow / test_parquet_dataset_factory_fsspec

Function test_parquet_dataset_factory_fsspec

python/pyarrow/tests/test_dataset.py:3825–3842  ·  view source on GitHub ↗
(tempdir)

Source from the content-addressed store, hash-verified

3823@pytest.mark.skipif(sys.platform == 'win32',
3824 reason="Results in FileNotFoundError on Windows")
3825def test_parquet_dataset_factory_fsspec(tempdir):
3826 # https://issues.apache.org/jira/browse/ARROW-16413
3827 fsspec = pytest.importorskip("fsspec")
3828
3829 # create dataset with pyarrow
3830 root_path = tempdir / "test_parquet_dataset"
3831 metadata_path, table = _create_parquet_dataset_simple(root_path)
3832
3833 # read using fsspec filesystem
3834 fsspec_fs = fsspec.filesystem("file")
3835 # manually creating a PyFileSystem, because passing the local fsspec
3836 # filesystem would internally be converted to native LocalFileSystem
3837 filesystem = fs.PyFileSystem(fs.FSSpecHandler(fsspec_fs))
3838 dataset = ds.parquet_dataset(metadata_path, filesystem=filesystem)
3839 assert dataset.schema.equals(table.schema)
3840 assert len(dataset.files) == 4
3841 result = dataset.to_table()
3842 assert result.num_rows == 40
3843
3844
3845@pytest.mark.parquet

Callers

nothing calls this directly

Calls 6

lenFunction · 0.85
filesystemMethod · 0.80
PyFileSystemMethod · 0.80
equalsMethod · 0.80
to_tableMethod · 0.45

Tested by

no test coverage detected