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

Source from the content-addressed store, hash-verified

5272
5273@pytest.mark.parquet
5274def test_dataset_null_to_dictionary_cast(tempdir, dataset_reader):
5275 # ARROW-12420
5276 table = pa.table({"a": [None, None]})
5277 pq.write_table(table, tempdir / "test.parquet")
5278
5279 schema = pa.schema([
5280 pa.field("a", pa.dictionary(pa.int32(), pa.string()))
5281 ])
5282 fsds = ds.FileSystemDataset.from_paths(
5283 paths=[tempdir / "test.parquet"],
5284 schema=schema,
5285 format=ds.ParquetFileFormat(),
5286 filesystem=fs.LocalFileSystem(),
5287 )
5288 table = dataset_reader.to_table(fsds)
5289 assert table.schema == schema
5290
5291
5292@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