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

Function test_construct_from_single_file

python/pyarrow/tests/test_dataset.py:2497–2513  ·  view source on GitHub ↗
(tempdir, dataset_reader, pickle_module)

Source from the content-addressed store, hash-verified

2495
2496@pytest.mark.parquet
2497def test_construct_from_single_file(tempdir, dataset_reader, pickle_module):
2498 directory = tempdir / 'single-file'
2499 directory.mkdir()
2500 table, path = _create_single_file(directory)
2501 relative_path = path.relative_to(directory)
2502
2503 # instantiate from a single file
2504 d1 = ds.dataset(path)
2505 # instantiate from a single file with a filesystem object
2506 d2 = ds.dataset(path, filesystem=fs.LocalFileSystem())
2507 # instantiate from a single file with prefixed filesystem URI
2508 d3 = ds.dataset(str(relative_path), filesystem=_filesystem_uri(directory))
2509 # pickle roundtrip
2510 d4 = pickle_module.loads(pickle_module.dumps(d1))
2511
2512 assert dataset_reader.to_table(d1) == dataset_reader.to_table(
2513 d2) == dataset_reader.to_table(d3) == dataset_reader.to_table(d4)
2514
2515
2516@pytest.mark.parquet

Callers

nothing calls this directly

Calls 6

_filesystem_uriFunction · 0.90
_create_single_fileFunction · 0.85
LocalFileSystemMethod · 0.80
loadsMethod · 0.80
dumpsMethod · 0.80
to_tableMethod · 0.45

Tested by

no test coverage detected