SAY-5 commented on PR #3682:
URL: https://github.com/apache/iceberg-python/pull/3682#issuecomment-5024482343

   Good question. The `_source_type` PrivateAttr on `TruncateTransform` is 
never assigned anywhere in the codebase, so `self.source_type` raises 
`AttributeError` on any non-equal comparison, which is the crash this PR fixes 
(#3680). That means the previous `StringType` branch never actually ran for a 
bare `TruncateTransform(n)` either.
   
   For the widening concern: `satisfies_order_of` is only meaningful when both 
transforms are bound to the same source field (same sort key), so they already 
share a type family by construction; a truncate transform carries no 
independent source type to cross-compare. This also matches the sibling 
transforms in this file, e.g. the time transforms compare purely on 
`granularity` and `BucketTransform` on `num_buckets`, without re-checking the 
source type. The added test asserts a non-truncate (`BucketTransform`) returns 
`False`, so cross-transform mixing is still rejected. Happy to add an explicit 
same-family guard if you'd prefer it spelled out.
   


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