rambleraptor commented on code in PR #3854:
URL: https://github.com/apache/iceberg-python/pull/3854#discussion_r3875258754
##########
tests/test_transforms.py:
##########
@@ -513,6 +513,37 @@ def test_truncate_method(type_var: PrimitiveType, value:
Any, expected_human_str
assert truncate_transform.satisfies_order_of(truncate_transform)
+def test_truncate_satisfies_order_of() -> None:
+ # Width comparison
+ assert TruncateTransform(5).satisfies_order_of(TruncateTransform(3))
+ assert TruncateTransform(5).satisfies_order_of(TruncateTransform(5))
+ assert not TruncateTransform(3).satisfies_order_of(TruncateTransform(5))
+ assert TruncateTransform(10).satisfies_order_of(TruncateTransform(1))
+ assert not TruncateTransform(1).satisfies_order_of(TruncateTransform(10))
+ assert TruncateTransform(1).satisfies_order_of(TruncateTransform(1))
+
+ # Cross-transform comparisons
+ assert not TruncateTransform(5).satisfies_order_of(BucketTransform(5))
+ assert not TruncateTransform(5).satisfies_order_of(IdentityTransform())
+ assert not TruncateTransform(5).satisfies_order_of(VoidTransform())
+ assert not TruncateTransform(5).satisfies_order_of(DayTransform())
+ assert not TruncateTransform(5).satisfies_order_of(YearTransform())
+ assert not
TruncateTransform(5).satisfies_order_of(UnknownTransform("unknown"))
+
+ # Non-transform comparisons
+ assert not TruncateTransform(5).satisfies_order_of(None) # type: ignore
Review Comment:
What were the type errors you saw here? In general, we should try to avoid
adding `type: ignore` whenever possible. It usually ends up being a code-sniff
for a deeper issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]