samredai commented on code in PR #4816:
URL: https://github.com/apache/iceberg/pull/4816#discussion_r877409487
##########
python/src/iceberg/expressions/base.py:
##########
@@ -267,6 +204,34 @@ def __str__(self) -> str:
return "false"
+class In(BooleanExpression):
Review Comment:
Now that we're moving away from having the single `Predicate` class, I still
think we can do some things to allow grouping downstream (for like methods that
must take a "predicate" or more specifically an "unbound predicate"). What do
you think of adding this?
```py
class BoundPredicate:
@abstractmethod
def __init__(self, left, right):
"""A concrete predicate must have a `left` and `right`"""
def eval(self, obj) -> bool:
"""Evaluate the bound predicate"""
class UnboundPredicate:
@abstractmethod
def __init__(self, left, right):
"""A concrete predicate must have a `left` and `right`"""
def bind(self, schema) -> BoundPredicate:
"""Bind to a schema to create a BoundPredicate"""
class In(BooleanExpression, UnboundPredicate):
def __init__(self, left: 'UnboundReference', right: List[Literal]):
...
```
We can then add a `BoundIn(BooleanExpression, BoundPredicate)` class in a
follow-up PR.
--
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]