MCPcopy Create free account
hub / github.com/apache/arrow / test_dataset_schema_metadata

Function test_dataset_schema_metadata

python/pyarrow/tests/test_dataset.py:4022–4035  ·  view source on GitHub ↗
(tempdir, dataset_reader)

Source from the content-addressed store, hash-verified

4020@pytest.mark.parquet
4021@pytest.mark.pandas
4022def 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

Callers

nothing calls this directly

Calls 2

equalsMethod · 0.80
to_tableMethod · 0.45

Tested by

no test coverage detected