Fokko commented on code in PR #2561:
URL: https://github.com/apache/iceberg-python/pull/2561#discussion_r2440788909
##########
pyiceberg/expressions/__init__.py:
##########
@@ -743,12 +749,18 @@ def as_bound(self) -> Type[BoundNotIn[L]]:
return BoundNotIn[L]
-class LiteralPredicate(UnboundPredicate[L], ABC):
- literal: Literal[L]
+class LiteralPredicate(IcebergBaseModel, UnboundPredicate[L], ABC):
+ type: TypingLiteral["lt", "lt-eq", "gt", "gt-eq", "eq", "not-eq",
"starts-with", "not-starts-with"] = Field(alias="type")
+ term: UnboundTerm[Any]
+ value: Literal[L] = Field()
+ model_config = ConfigDict(populate_by_name=True, frozen=True,
arbitrary_types_allowed=True)
- def __init__(self, term: Union[str, UnboundTerm[Any]], literal: Union[L,
Literal[L]]): # pylint: disable=W0621
- super().__init__(term)
- self.literal = _to_literal(literal) # pylint: disable=W0621
+ def __init__(self, term: Union[str, UnboundTerm[Any],
BoundReference[Any]], literal: Union[L, Literal[L]]):
Review Comment:
```suggestion
def __init__(self, term: Union[str, UnboundTerm[Any]], literal: Union[L,
Literal[L]]):
```
--
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]