Skip to content

Commit 53c9bf9

Browse files
inspect: surface key_metadata in all_manifests (iceberg 1.11.0, apache/iceberg#14750)
1 parent 48644d0 commit 53c9bf9

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

pyiceberg/table/inspect.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ def _get_all_manifests_schema(self) -> pa.Schema:
404404

405405
all_manifests_schema = self._get_manifests_schema()
406406
all_manifests_schema = all_manifests_schema.append(pa.field("reference_snapshot_id", pa.int64(), nullable=False))
407+
# Iceberg 1.11.0 (apache/iceberg#14750) added key_metadata to the all_manifests table only.
408+
all_manifests_schema = all_manifests_schema.append(pa.field("key_metadata", pa.binary(), nullable=True))
407409
return all_manifests_schema
408410

409411
def _generate_manifests_table(self, snapshot: Snapshot | None, is_all_manifests_table: bool = False) -> pa.Table:
@@ -468,6 +470,7 @@ def _partition_summaries_to_rows(
468470
}
469471
if is_all_manifests_table:
470472
manifest_row["reference_snapshot_id"] = snapshot.snapshot_id
473+
manifest_row["key_metadata"] = manifest.key_metadata
471474
manifests.append(manifest_row)
472475

473476
return pa.Table.from_pylist(

tests/integration/test_inspect_table.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,7 @@ def test_inspect_all_manifests(spark: SparkSession, session_catalog: Catalog, fo
10121012
"deleted_delete_files_count",
10131013
"partition_summaries",
10141014
"reference_snapshot_id",
1015+
"key_metadata",
10151016
]
10161017

10171018
int_cols = [

0 commit comments

Comments
 (0)