Skip to content

#1820 Add Geography/Geometry type #2224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Gawaboumga
Copy link

Rationale for this change

Iceberg V3 supports both Geography & Geometry types.

Are these changes tested?

Not enough

Copy link
Contributor

@rambleraptor rambleraptor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this! I've got a couple of suggestions

else:
raise ValidationError(f"Could not parse {geography} into a GeographyType")
elif isinstance(geography, dict):
return geography["crs"], geography["edge_algorithm"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you throw a user-readable error if either of these do not exist on the dictionary?

Copy link
Author

@Gawaboumga Gawaboumga Jul 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have created a _raise_if_any_missing_dictionary_key function, and applied it also to DecimalType & FixedType

else:
raise ValidationError(f"Could not parse {geometry} into a GeometryType")
elif isinstance(geometry, dict):
return geometry["crs"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you throw a user-readable error if either of these do not exist on the dictionary?



def test_repr_geometry() -> None:
assert repr(GeometryType()) == "GeometryType(crs=None)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the spec, crs can not be None.

Image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Java, they took the position to store nulls, here it was not clear wether __str__ should behaved as ser_model. Nonetheless, it has been changed for both.

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.

2 participants