Skip to content

Types: Serialize geometry and geography without quoted parameters - #4482

Open
Anurag-S1ngh wants to merge 1 commit into
apache:mainfrom
Anurag-S1ngh:fix/4079-geo-type-unquoted
Open

Anurag-S1ngh wants to merge 1 commit into
apache:mainfrom
Anurag-S1ngh:fix/4079-geo-type-unquoted

Conversation

@Anurag-S1ngh

Copy link
Copy Markdown
Contributor

Rationale for this change

GeometryType and GeographyType serialize non-default parameters with quotes, for example geometry('EPSG:4326'). The Iceberg type serialization table defines the canonical form without quotes, for example geometry(srid:4326) and geography(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 passed
  • pytest tests/ -m unit --ignore=tests/integration: 4882 passed, 6 skipped
  • ruff check and ruff format --check pass

Are there any user-facing changes?

Yes. Type strings written to table metadata now use the canonical unquoted form. Older quoted metadata remains readable.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant