SAY-5 commented on code in PR #3682:
URL: https://github.com/apache/iceberg-python/pull/3682#discussion_r3791488179


##########
pyiceberg/transforms.py:
##########
@@ -897,11 +897,7 @@ def truncate_func(v: Any) -> Any:
     def satisfies_order_of(self, other: Transform[S, T]) -> bool:
         if self == other:
             return True
-        elif (
-            isinstance(self.source_type, StringType)
-            and isinstance(other, TruncateTransform)
-            and isinstance(other.source_type, StringType)
-        ):
+        elif isinstance(other, TruncateTransform):

Review Comment:
   Intentional. `_source_type` is a `PrivateAttr` that is never assigned on 
`TruncateTransform`, so `self.source_type` raised `AttributeError` and the 
whole branch was dead, string vs string included.
   
   Java can gate on type because it has separate 
`TruncateString`/`TruncateInteger`/`TruncateDecimal` classes; pyiceberg has one 
width-carrying transform with no bound type, same as iceberg-rust, which also 
compares widths only. And `satisfies_order_of` is only ever asked between 
transforms on the same source field, so a string truncate never gets handed an 
int one in practice.



-- 
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]

Reply via email to