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

Source from the content-addressed store, hash-verified

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