HonahX commented on code in PR #8267:
URL: https://github.com/apache/iceberg/pull/8267#discussion_r1289664294


##########
python/pyiceberg/expressions/literals.py:
##########
@@ -139,7 +139,7 @@ def literal(value: L) -> Literal[L]:
     elif isinstance(value, str):
         return StringLiteral(value)
     elif isinstance(value, UUID):
-        return UUIDLiteral(value)
+        return UUIDLiteral(value)  # type: ignore

Review Comment:
   Thanks for the explanation! I added conversions from `BinaryLiteral` to 
`UUID` and from `FixedLiteral` to `UUID`, and related tests.
   Here is a summarization of the supported conversion now:
   ```python
   from pyiceberg.expressions.literals import *
   from pyiceberg.types import *
   import uuid
   
   test_uuid = uuid.UUID('d4ccb06d-e7de-48e6-ad05-649fe8deda50')
   
   lu = literal(test_uuid)
   ls = literal('d4ccb06d-e7de-48e6-ad05-649fe8deda50')
   lbinary = literal(test_uuid.bytes)
   lfixed = literal(test_uuid.bytes).to(FixedType(16))
   
   assert lu.value == test_uuid.bytes
   assert ls.to(UUIDType()) == lu
   assert lbinary.to(UUIDType()) == lu
   assert lfixed.to(UUIDType()) == lu
   ```
   
   



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