-
Notifications
You must be signed in to change notification settings - Fork 510
Reject unsupported identity transform types #3517
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,6 +101,8 @@ | |
| DoubleType, | ||
| FixedType, | ||
| FloatType, | ||
| GeographyType, | ||
| GeometryType, | ||
| IntegerType, | ||
| LongType, | ||
| NestedField, | ||
|
|
@@ -255,6 +257,11 @@ def test_identity_transform_unknown_type() -> None: | |
| assert IdentityTransform().to_human_string(UnknownType(), None) == "null" | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("type_var", [GeometryType(), GeographyType()]) | ||
| def test_identity_can_transform_unsupported_type(type_var: PrimitiveType) -> None: | ||
| assert not IdentityTransform().can_transform(type_var) | ||
|
|
||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could improve the test coverage for other methods such as If we want to test
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed as suggested, thanks |
||
| def test_string_with_surrogate_pair() -> None: | ||
| string_with_surrogate_pair = "string with a surrogate pair: 💰" | ||
| as_bytes = bytes(string_with_surrogate_pair, UTF8) | ||
|
|
||
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 completely understand that VariantType isn't a primitive, but I think we should add it here:
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.
Yeah, I agree we should follow the spec before a decision is made to change it. However, after searching the codebase, it seems that
VariantTypeis not currently supported in Iceberg Python, and supportingVariantTypefeels like a much broader effort that should probably be addressed in a separate PR, WDYT?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.
Maybe just add a TODO and let's move on?
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.
Added, thanks.