(tempdir)
| 3823 | @pytest.mark.skipif(sys.platform == 'win32', |
| 3824 | reason="Results in FileNotFoundError on Windows") |
| 3825 | def 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 |
nothing calls this directly
no test coverage detected