Skip to content

Commit b440682

Browse files
Fix for metadata entries table for MOR tables containing Delete Files. (#1902)
<!-- Thanks for opening a pull request! --> <!-- In the case this PR will resolve an issue, please replace ${GITHUB_ISSUE_ID} below with the actual Github issue id. --> Closes #1884 # Rationale for this change table.inspect.entries() fails when table is MOR table and has Delete Files present in it. Iceberg MOR Table is created via Apache Spark 3.5.0 with Iceberg 1.5.0 and it's being read via PyIceberg 0.9.0 using StaticTable.from_metadata() # Are these changes tested? Yes # Are there any user-facing changes? No <!-- In the case of user-facing changes, please add the changelog label. -->
1 parent 3c52167 commit b440682

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pyiceberg/table/inspect.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ def _readable_metrics_struct(bound_type: PrimitiveType) -> pa.StructType:
205205
"record_count": entry.data_file.record_count,
206206
"file_size_in_bytes": entry.data_file.file_size_in_bytes,
207207
"column_sizes": dict(entry.data_file.column_sizes),
208-
"value_counts": dict(entry.data_file.value_counts),
209-
"null_value_counts": dict(entry.data_file.null_value_counts),
210-
"nan_value_counts": dict(entry.data_file.nan_value_counts),
208+
"value_counts": dict(entry.data_file.value_counts or {}),
209+
"null_value_counts": dict(entry.data_file.null_value_counts or {}),
210+
"nan_value_counts": dict(entry.data_file.nan_value_counts or {}),
211211
"lower_bounds": entry.data_file.lower_bounds,
212212
"upper_bounds": entry.data_file.upper_bounds,
213213
"key_metadata": entry.data_file.key_metadata,

0 commit comments

Comments
 (0)