Skip to content

Commit

Permalink
Comments, thanks Honah!
Browse files Browse the repository at this point in the history
  • Loading branch information
Fokko committed Mar 25, 2024
1 parent 88c52cf commit 73b06a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pyiceberg/expressions/visitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1451,8 +1451,8 @@ def visit_bound_predicate(self, predicate: BoundPredicate[Any]) -> BooleanExpres
# predicate. For example, ts = 2019-01-01T03:00:00 matches the hour projection but not
# the day, but does match the original predicate.
strict_projection = part.transform.strict_project(name=part.name, pred=predicate)
if incl_projection is not None:
result = Or(result, incl_projection)
if strict_projection is not None:
result = Or(result, strict_projection)

return result

Expand Down
6 changes: 3 additions & 3 deletions pyiceberg/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,10 @@ def project(self, name: str, pred: BoundPredicate[L]) -> Optional[UnboundPredica
return pred.as_unbound(Reference(name))
elif isinstance(pred, BoundLiteralPredicate):
return pred.as_unbound(Reference(name), pred.literal)
elif isinstance(pred, (BoundIn, BoundNotIn)):
elif isinstance(pred, BoundSetPredicate):
return pred.as_unbound(Reference(name), pred.literals)
else:
raise ValueError(f"Could not project: {pred}")
return None

def strict_project(self, name: str, pred: BoundPredicate[Any]) -> Optional[UnboundPredicate[Any]]:
if isinstance(pred, BoundUnaryPredicate):
Expand All @@ -564,7 +564,7 @@ def strict_project(self, name: str, pred: BoundPredicate[Any]) -> Optional[Unbou
elif isinstance(pred, BoundSetPredicate):
return pred.as_unbound(Reference(name), pred.literals)
else:
raise ValueError(f"Could not project: {pred}")
return None

@property
def preserves_order(self) -> bool:
Expand Down

0 comments on commit 73b06a6

Please sign in to comment.