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

Function test_open_dataset_filesystem

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

Source from the content-addressed store, hash-verified

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