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

Function test_write_dataset_with_field_names

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

Source from the content-addressed store, hash-verified

4291
4292
4293def test_write_dataset_with_field_names(tempdir):
4294 table = pa.table({'a': ['x', 'y', None], 'b': ['x', 'y', 'z']})
4295
4296 ds.write_dataset(table, tempdir, format='ipc',
4297 partitioning=["b"])
4298
4299 load_back = ds.dataset(tempdir, format='ipc', partitioning=["b"])
4300 files = load_back.files
4301 partitioning_dirs = {
4302 str(pathlib.Path(f).relative_to(tempdir).parent) for f in files
4303 }
4304 assert partitioning_dirs == {"x", "y", "z"}
4305
4306 load_back_table = load_back.to_table()
4307 assert load_back_table.equals(table)
4308
4309
4310def test_write_dataset_with_field_names_hive(tempdir):

Callers

nothing calls this directly

Calls 3

equalsMethod · 0.80
PathMethod · 0.45
to_tableMethod · 0.45

Tested by

no test coverage detected