Core: Preserve empty partition bounds in inspect.manifests#3708
Open
fallintoplace wants to merge 1 commit into
Open
Core: Preserve empty partition bounds in inspect.manifests#3708fallintoplace wants to merge 1 commit into
fallintoplace wants to merge 1 commit into
Conversation
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.
Rationale for this change
Manifest partition summaries encode string bounds as bytes. An empty string is represented by
b"", butInspectTable.manifests()checked encoded bounds by truthiness. As a result, valid empty-string lower and upper bounds were returned as null.This change checks whether each bound is absent instead, preserving empty values while continuing to return null for missing bounds. This matches Apache Iceberg Java's manifests metadata table.
Are these changes tested?
Yes. A regression test writes a table partitioned by an identity-transformed string containing an empty value and verifies that both manifest partition bounds remain empty strings.
The following checks pass locally:
PYTHONPATH=. uv run pytest tests/table/test_inspect.py -q(5 passed)PYTHONPATH=. uv run --extra datafusion --extra pyiceberg-core pytest -p no:cacheprovider tests/table -q(328 passed)make lintAre there any user-facing changes?
Yes.
table.inspect.manifests()now reports empty-string partition bounds as empty strings instead of null. There are no API changes.