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

Function test_open_dataset_filesystem

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

Source from the content-addressed store, hash-verified

2770
2771@pytest.mark.parquet
2772def test_open_dataset_filesystem(tempdir):
2773 # single file
2774 table, path = _create_single_file(tempdir)
2775
2776 # filesystem inferred from path
2777 dataset1 = ds.dataset(str(path))
2778 assert dataset1.schema.equals(table.schema)
2779
2780 # filesystem specified
2781 dataset2 = ds.dataset(str(path), filesystem=fs.LocalFileSystem())
2782 assert dataset2.schema.equals(table.schema)
2783
2784 # local filesystem specified with relative path
2785 with change_cwd(tempdir):
2786 dataset3 = ds.dataset("test.parquet", filesystem=fs.LocalFileSystem())
2787 assert dataset3.schema.equals(table.schema)
2788
2789 # passing different filesystem
2790 with pytest.raises(FileNotFoundError):
2791 ds.dataset(str(path), filesystem=fs._MockFileSystem())
2792
2793
2794@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