Skip to content

Commit 48daa18

Browse files
committed
Add __str__
1 parent c570b54 commit 48daa18

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pyiceberg/expressions/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,10 @@ def __eq__(self, other: Any) -> bool:
483483
return self.term == other.term
484484
return False
485485

486+
def __str__(self) -> str:
487+
"""Return the string representation of the BoundPredicate class."""
488+
return f"{self.__class__.__name__}(term={str(self.term)})"
489+
486490
@property
487491
@abstractmethod
488492
def as_unbound(self) -> type[UnboundPredicate]: ...
@@ -911,6 +915,10 @@ def __eq__(self, other: Any) -> bool:
911915
return self.term == other.term and self.literal == other.literal
912916
return False
913917

918+
def __str__(self) -> str:
919+
"""Return the string representation of the BoundLiteralPredicate class."""
920+
return f"{self.__class__.__name__}(term={str(self.term)}, literal={repr(self.literal)})"
921+
914922
def __repr__(self) -> str:
915923
"""Return the string representation of the BoundLiteralPredicate class."""
916924
return f"{str(self.__class__.__name__)}(term={repr(self.term)}, literal={repr(self.literal)})"

0 commit comments

Comments
 (0)