rdblue commented on code in PR #6141: URL: https://github.com/apache/iceberg/pull/6141#discussion_r1022102882
########## python/pyiceberg/expressions/literals.py: ########## @@ -309,19 +336,19 @@ 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[FloatAboveMax, FloatBelowMin, FloatLiteral]: Review Comment: This can return `Literal[float]` now, right? -- 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