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

Source from the content-addressed store, hash-verified

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