Repository navigation
Fix inspect.entries() when column_sizes is missing - #4199
Merged
kevinjqliu merged 4 commits intoNov 19, 2026
Merged
Conversation
ebyhr
reviewed
Oct 30, 2026
Comment on lines
+82
to
+83
| # column_sizes and the other metric maps are optional in a data file; DuckDB, for one, | ||
| # writes data files without column_sizes. |
Member
There was a problem hiding this comment.
nit: The spec already makes these maps optional, so the DuckDB aside isn't needed. Could shorten to one line: "# column_sizes and the other metric maps are optional in a data file"?
3 tasks
column_sizes is optional in a data file, but entries() built it with
dict(entry.data_file.column_sizes), which raises TypeError when it is
missing. DuckDB writes data files without it. Use the `or {}` that
Closes apache#4186
kevinjqliu
approved these changes
Nov 19, 2026
| "record_count": entry.data_file.record_count, | ||
| "file_size_in_bytes": entry.data_file.file_size_in_bytes, | ||
| "column_sizes": dict(entry.data_file.column_sizes), | ||
| "column_sizes": dict(entry.data_file.column_sizes or {}), |
Contributor
There was a problem hiding this comment.
The snapshot producer now reads DataFile.spec_id, so the test failed after rebasing onto main. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kevinjqliu
force-pushed
the
fix/4186-entries-missing-column-sizes
branch
from
November 19, 2026 20:23
2d453fb to
f6eadf1
Compare
inspect only reads manifests, so the data file doesn't need to exist. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
inspect.entries() when column_sizes is missing
kevinjqliu
enabled auto-merge
November 19, 2026 20:26
Contributor
|
Thanks @Rahul-cs50 i pushed 2 commits @ebyhr thanks for the review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #4186
Rationale for this change
column_sizesis optional in a data file, butinspect.entries()builds it withdict(entry.data_file.column_sizes), which raisesTypeError: 'NoneType' object is not iterablewhen the field is absent. DuckDB omits it from the files it writes, and Iceberg Java's deletion vectors carry no column metrics, soentries()fails on those tables.This applies the
or {}that #1902 added tovalue_counts,null_value_counts, andnan_value_counts.files()and thereadable_metricscolumn already handle the missing field.Note:
entries()reports a missing metric map as an empty map, whilefiles()and Java reportnull. Aligning all four maps with Java changes existing output, so it is left for a follow-up.Are these changes tested?
Yes.
test_inspect_entries_and_files_with_data_file_without_metricscommits a data file without metrics and readsentries()andfiles(). Without the fix it fails with theTypeErrorabove.uv run python -m pytest -m unit tests/table/test_inspect.py: 9 passedAre there any user-facing changes?
inspect.entries()no longer raises on data or delete files withoutcolumn_sizes.