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

Source from the content-addressed store, hash-verified

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