(tempdir, dataset_reader)
| 5229 | |
| 5230 | @pytest.mark.parquet |
| 5231 | def 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 |
nothing calls this directly
no test coverage detected