rdblue commented on code in PR #6141:
URL: https://github.com/apache/iceberg/pull/6141#discussion_r1019384042


##########
python/pyiceberg/expressions/literals.py:
##########
@@ -125,81 +127,73 @@ def literal(value) -> Literal:
 
 
 @literal.register(bool)
-def _(value: bool) -> Literal[bool]:
+def _(value: bool) -> BooleanLiteral:
     return BooleanLiteral(value)
 
 
 @literal.register(int)
-def _(value: int) -> Literal[int]:
+def _(value: int) -> LongLiteral:
     return LongLiteral(value)
 
 
 @literal.register(float)
-def _(value: float) -> Literal[float]:
+def _(value: float) -> DoubleLiteral:
     # expression binding can convert to FloatLiteral if needed
     return DoubleLiteral(value)
 
 
 @literal.register(str)
-def _(value: str) -> Literal[str]:
+def _(value: str) -> StringLiteral:
     return StringLiteral(value)
 
 
 @literal.register(UUID)
-def _(value: UUID) -> Literal[UUID]:
+def _(value: UUID) -> UUIDLiteral:
     return UUIDLiteral(value)
 
 
 @literal.register(bytes)
-def _(value: bytes) -> Literal[bytes]:
+def _(value: bytes) -> BinaryLiteral:
     # expression binding can convert to FixedLiteral if needed
     return BinaryLiteral(value)
 
 
 @literal.register(bytearray)
-def _(value: bytearray) -> Literal[bytes]:
+def _(value: bytearray) -> BinaryLiteral:
     return BinaryLiteral(bytes(value))
 
 
 @literal.register(Decimal)
-def _(value: Decimal) -> Literal[Decimal]:
+def _(value: Decimal) -> DecimalLiteral:
     return DecimalLiteral(value)
 
 
 @literal.register(date)
-def _(value: date) -> Literal[int]:
+def _(value: date) -> DateLiteral:
     return DateLiteral(date_to_days(value))
 
 
-class AboveMax(Singleton):
-    @property
-    def value(self):
-        raise ValueError("AboveMax has no value")
-
-    def to(self, type_var):
+class AboveMax(Literal):
+    @singledispatchmethod

Review Comment:
   Since there's only one implementation of `to`, can we remove this annotation?



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to