Repository navigation
Types: Serialize geometry and geography without quoted parameters - #4482
Open
Anurag-S1ngh wants to merge 1 commit into
Open
Anurag-S1ngh wants to merge 1 commit into
Anurag-S1ngh wants to merge 1 commit into
Conversation
Match the canonical type strings in the Iceberg spec so metadata written by PyIceberg uses the same form as Java. Parsing still accepts the quoted forms.
This branch has not been deployed
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
GeometryTypeandGeographyTypeserialize non-default parameters with quotes, for examplegeometry('EPSG:4326'). The Iceberg type serialization table defines the canonical form without quotes, for examplegeometry(srid:4326)andgeography(srid:4326, spherical).Parsing the unquoted form already landed in #4422. This completes that item by emitting the spec form, while keeping the quoted forms readable for metadata written by older versions.
Part of #4079.
Are these changes tested?
Yes. Updated the geometry and geography serialization tests and added JSON round-trip assertions for the new output. The existing quoted-input parsing tests remain in place.
pytest tests/test_types.py: 291 passedpytest tests/ -m unit --ignore=tests/integration: 4882 passed, 6 skippedruff checkandruff format --checkpassAre there any user-facing changes?
Yes. Type strings written to table metadata now use the canonical unquoted form. Older quoted metadata remains readable.