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:2503–2519  ·  view source on GitHub ↗
(tempdir, dataset_reader, pickle_module)

Source from the content-addressed store, hash-verified

2501
2502@pytest.mark.parquet
2503def test_construct_from_single_file(tempdir, dataset_reader, pickle_module):
2504 directory = tempdir / 'single-file'
2505 directory.mkdir()
2506 table, path = _create_single_file(directory)
2507 relative_path = path.relative_to(directory)
2508
2509 # instantiate from a single file
2510 d1 = ds.dataset(path)
2511 # instantiate from a single file with a filesystem object
2512 d2 = ds.dataset(path, filesystem=fs.LocalFileSystem())
2513 # instantiate from a single file with prefixed filesystem URI
2514 d3 = ds.dataset(str(relative_path), filesystem=_filesystem_uri(directory))
2515 # pickle roundtrip
2516 d4 = pickle_module.loads(pickle_module.dumps(d1))
2517
2518 assert dataset_reader.to_table(d1) == dataset_reader.to_table(
2519 d2) == dataset_reader.to_table(d3) == dataset_reader.to_table(d4)
2520
2521
2522@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