Fokko commented on code in PR #2598:
URL: https://github.com/apache/iceberg-python/pull/2598#discussion_r2445070693


##########
pyiceberg/expressions/__init__.py:
##########
@@ -447,7 +447,15 @@ def bind(self, schema: Schema, case_sensitive: bool = 
True) -> BooleanExpression
     def as_bound(self) -> Type[BoundPredicate[L]]: ...
 
 
-class UnaryPredicate(UnboundPredicate[Any], ABC):
+class UnaryPredicate(IcebergBaseModel, UnboundPredicate[Any], ABC):
+    type: str
+
+    model_config = {"arbitrary_types_allowed": True}
+
+    def __init__(self, term: Union[str, UnboundTerm[Any]]):
+        unbound = _to_unbound_term(term)
+        super().__init__(term=unbound)
+

Review Comment:
   Let's set this one by hand:
   ```suggestion
   
       def __str__(self) -> str:
           """Return the string representation of the UnaryPredicate class."""
           # Sort to make it deterministic
           return f"{str(self.__class__.__name__)}(term={str(self.term)})"
   
   ```



-- 
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]

Reply via email to