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:3826–3843  ·  view source on GitHub ↗
(tempdir)

Source from the content-addressed store, hash-verified

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