-
Notifications
You must be signed in to change notification settings - Fork 340
#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
base: main
Are you sure you want to change the base?
#1820 Add Geography/Geometry type #2224
Conversation
There was a problem hiding this 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"] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"] |
There was a problem hiding this comment.
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?
tests/test_types.py
Outdated
|
||
|
||
def test_repr_geometry() -> None: | ||
assert repr(GeometryType()) == "GeometryType(crs=None)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
Rationale for this change
Iceberg V3 supports both Geography & Geometry types.
Are these changes tested?
Not enough