rambleraptor commented on code in PR #3517:
URL: https://github.com/apache/iceberg-python/pull/3517#discussion_r3423315433


##########
pyiceberg/transforms.py:
##########
@@ -717,7 +719,7 @@ def transform(self, source: IcebergType) -> Callable[[S | 
None], S | None]:
         return lambda v: v
 
     def can_transform(self, source: IcebergType) -> bool:
-        return source.is_primitive
+        return source.is_primitive and not isinstance(source, (GeographyType, 
GeometryType))

Review Comment:
   I completely understand that VariantType isn't a primitive, but I think we 
should add it here:
   
   - It doesn't hurt anything, since it won't be called
   - It stops a couple LLM-generated PRs come in that "notice" that VariantType 
is missing here
   - It makes this method explicitly match the spec. The code should match the 
spec. Divergences are where people begin to not trust the spec.



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