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:4286–4300  ·  view source on GitHub ↗
(tempdir)

Source from the content-addressed store, hash-verified

4284
4285
4286def test_write_dataset_with_field_names(tempdir):
4287 table = pa.table({'a': ['x', 'y', None], 'b': ['x', 'y', 'z']})
4288
4289 ds.write_dataset(table, tempdir, format='ipc',
4290 partitioning=["b"])
4291
4292 load_back = ds.dataset(tempdir, format='ipc', partitioning=["b"])
4293 files = load_back.files
4294 partitioning_dirs = {
4295 str(pathlib.Path(f).relative_to(tempdir).parent) for f in files
4296 }
4297 assert partitioning_dirs == {"x", "y", "z"}
4298
4299 load_back_table = load_back.to_table()
4300 assert load_back_table.equals(table)
4301
4302
4303def 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