| 4020 | @pytest.mark.parquet |
| 4021 | @pytest.mark.pandas |
| 4022 | def test_dataset_schema_metadata(tempdir, dataset_reader): |
| 4023 | # ARROW-8802 |
| 4024 | df = pd.DataFrame({'a': [1, 2, 3]}) |
| 4025 | path = tempdir / "test.parquet" |
| 4026 | df.to_parquet(path) |
| 4027 | dataset = ds.dataset(path) |
| 4028 | |
| 4029 | schema = dataset_reader.to_table(dataset).schema |
| 4030 | projected_schema = dataset_reader.to_table(dataset, columns=["a"]).schema |
| 4031 | |
| 4032 | # ensure the pandas metadata is included in the schema |
| 4033 | assert b"pandas" in schema.metadata |
| 4034 | # ensure it is still there in a projected schema (with column selection) |
| 4035 | assert schema.equals(projected_schema, check_metadata=True) |
| 4036 | |
| 4037 | |
| 4038 | @pytest.mark.parquet |