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


##########
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:
   AI-generated follow-up using OpenAI Codex; the current code and test 
revision was also generated with Codex.
   
   The width-only widening is incorrect even for the same integer field: values 
`[3, 2]` produce keys `[0, 0]` with width 5 and `[3, 0]` with width 3. Ordering 
by width 5 therefore does not guarantee ordering by width 3. The earlier 
statement that iceberg-rust compares truncate widths only was incorrect and 
should not have justified this change.
   
   The correction uses `self == other`: equal transforms return `True`, unequal 
widths return `False`, without reading `_source_type` or changing the public 
API signatures/property. This deliberately leaves type-specific unequal-width 
compatibility unrecognized for unbound transforms. The regression tests 
exercise the numeric counterexample, prefix ties, and independence from prior 
source-type calls. The new regressions fail on the previous implementation and 
pass with the correction. All 12 `make lint` hooks passed. The isolated `make 
test` run passed 3,779 tests, with 2 skipped and 123 deselected; two 
multiprocessing cases were explicitly excluded because spawned processes would 
not inherit the local isolation. Integration, cloud and notebook suites were 
not run locally; full validation remains with CI.
   



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