sungwy commented on code in PR #2750:
URL: https://github.com/apache/iceberg-python/pull/2750#discussion_r2536166527
##########
pyiceberg/expressions/visitors.py:
##########
@@ -242,60 +242,60 @@ def visit_and(self, left_result: BooleanExpression,
right_result: BooleanExpress
def visit_or(self, left_result: BooleanExpression, right_result:
BooleanExpression) -> BooleanExpression:
return Or(left=left_result, right=right_result)
- def visit_unbound_predicate(self, predicate: UnboundPredicate[L]) ->
BooleanExpression:
+ def visit_unbound_predicate(self, predicate: UnboundPredicate) ->
BooleanExpression:
return predicate.bind(self.schema, case_sensitive=self.case_sensitive)
- def visit_bound_predicate(self, predicate: BoundPredicate[L]) ->
BooleanExpression:
+ def visit_bound_predicate(self, predicate: BoundPredicate) ->
BooleanExpression:
raise TypeError(f"Found already bound predicate: {predicate}")
class BoundBooleanExpressionVisitor(BooleanExpressionVisitor[T], ABC):
@abstractmethod
- def visit_in(self, term: BoundTerm[L], literals: set[L]) -> T:
+ def visit_in(self, term: BoundTerm, literals: set[L]) -> T:
"""Visit a bound In predicate."""
@abstractmethod
- def visit_not_in(self, term: BoundTerm[L], literals: set[L]) -> T:
+ def visit_not_in(self, term: BoundTerm, literals: set[L]) -> T:
"""Visit a bound NotIn predicate."""
@abstractmethod
- def visit_is_nan(self, term: BoundTerm[L]) -> T:
+ def visit_is_nan(self, term: BoundTerm) -> T:
"""Visit a bound IsNan predicate."""
@abstractmethod
- def visit_not_nan(self, term: BoundTerm[L]) -> T:
+ def visit_not_nan(self, term: BoundTerm) -> T:
"""Visit a bound NotNan predicate."""
@abstractmethod
- def visit_is_null(self, term: BoundTerm[L]) -> T:
+ def visit_is_null(self, term: BoundTerm) -> T:
"""Visit a bound IsNull predicate."""
@abstractmethod
- def visit_not_null(self, term: BoundTerm[L]) -> T:
+ def visit_not_null(self, term: BoundTerm) -> T:
"""Visit a bound NotNull predicate."""
@abstractmethod
- def visit_equal(self, term: BoundTerm[L], literal: Literal[L]) -> T:
+ def visit_equal(self, term: BoundTerm, literal: Literal[L]) -> T:
Review Comment:
nit, but do you think it would make sense to align with your change in
`expressions/__init__.py` and use LiteralValue here?
```suggestion
def visit_equal(self, term: BoundTerm, literal: LiteralValue) -> T:
```
##########
pyiceberg/expressions/__init__.py:
##########
@@ -48,8 +36,13 @@
except ImportError:
ConfigDict = dict
+if TYPE_CHECKING:
+ LiteralValue = Literal[Any]
+else:
+ LiteralValue = Literal
Review Comment:
What are your thoughts on moving this to `pyiceberg.typedef` instead? I
think that'll allow it to be reused by other modules for static type checking.
--
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]