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

Function test_dataset_null_to_dictionary_cast

python/pyarrow/tests/test_dataset.py:5227–5242  ·  view source on GitHub ↗
(tempdir, dataset_reader)

Source from the content-addressed store, hash-verified

5225
5226@pytest.mark.parquet
5227def test_dataset_null_to_dictionary_cast(tempdir, dataset_reader):
5228 # ARROW-12420
5229 table = pa.table({"a": [None, None]})
5230 pq.write_table(table, tempdir / "test.parquet")
5231
5232 schema = pa.schema([
5233 pa.field("a", pa.dictionary(pa.int32(), pa.string()))
5234 ])
5235 fsds = ds.FileSystemDataset.from_paths(
5236 paths=[tempdir / "test.parquet"],
5237 schema=schema,
5238 format=ds.ParquetFileFormat(),
5239 filesystem=fs.LocalFileSystem(),
5240 )
5241 table = dataset_reader.to_table(fsds)
5242 assert table.schema == schema
5243
5244
5245@pytest.mark.dataset

Callers

nothing calls this directly

Calls 8

ParquetFileFormatMethod · 0.80
LocalFileSystemMethod · 0.80
write_tableMethod · 0.45
schemaMethod · 0.45
fieldMethod · 0.45
dictionaryMethod · 0.45
stringMethod · 0.45
to_tableMethod · 0.45

Tested by

no test coverage detected