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

Function test_open_dataset_filesystem

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

Source from the content-addressed store, hash-verified

2765
2766@pytest.mark.parquet
2767def test_open_dataset_filesystem(tempdir):
2768 # single file
2769 table, path = _create_single_file(tempdir)
2770
2771 # filesystem inferred from path
2772 dataset1 = ds.dataset(str(path))
2773 assert dataset1.schema.equals(table.schema)
2774
2775 # filesystem specified
2776 dataset2 = ds.dataset(str(path), filesystem=fs.LocalFileSystem())
2777 assert dataset2.schema.equals(table.schema)
2778
2779 # local filesystem specified with relative path
2780 with change_cwd(tempdir):
2781 dataset3 = ds.dataset("test.parquet", filesystem=fs.LocalFileSystem())
2782 assert dataset3.schema.equals(table.schema)
2783
2784 # passing different filesystem
2785 with pytest.raises(FileNotFoundError):
2786 ds.dataset(str(path), filesystem=fs._MockFileSystem())
2787
2788
2789@pytest.mark.parquet

Callers

nothing calls this directly

Calls 4

change_cwdFunction · 0.90
_create_single_fileFunction · 0.85
equalsMethod · 0.80
LocalFileSystemMethod · 0.80

Tested by

no test coverage detected