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


##########
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 your suggestion. I tried this and it turned out that the error 
here:
   ```
   Incompatible return value type (got "UUIDLiteral", expected "Literal[UUID]") 
 [return-value]
   ```
   is due to the `literal` function expecting a return value of `Literal(<Type 
of value>)`.
   Hence, we need this ignore since UUIDLiteral is now a `Literal[bytes]`
   
   
   I chose to let the initialization of `UUIDLiteral` still take `UUID` as 
input to maintain minimal changes to initialization code in other places.  I 
think letting `UUIDLiteral.__init__` takes `bytes` or `Union[bytes, uuid]` is 
also reasonable. Please let me know if you prefer other way of initialization 
this class.



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