rdblue commented on code in PR #6141: URL: https://github.com/apache/iceberg/pull/6141#discussion_r1019385197
########## python/pyiceberg/expressions/literals.py: ########## @@ -309,23 +303,23 @@ def __init__(self, value: float): super().__init__(value, float) @singledispatchmethod - def to(self, type_var): - return None + def to(self, type_var: IcebergType) -> Literal: + raise TypeError(f"Cannot convert DoubleLiteral into {type_var}") @to.register(DoubleType) - def _(self, type_var: DoubleType) -> Literal[float]: + def _(self, _: DoubleType) -> Literal[float]: return self @to.register(FloatType) - def _(self, _: FloatType) -> Union[AboveMax, BelowMin, Literal[float]]: + def _(self, _: FloatType) -> Union[AboveMax, BelowMin, FloatLiteral]: if FloatType.max < self.value: - return AboveMax() + return AboveMax(FloatType.max, float) Review Comment: I see, it looks like this is why these are no longer singletons. What about `FloatAboveMax` and `IntegerAboveMax` instead? We will only have 2. -- 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