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

Source from the content-addressed store, hash-verified

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