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

Source from the content-addressed store, hash-verified

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