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


##########
pyiceberg/expressions/__init__.py:
##########
@@ -447,7 +447,22 @@ 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
+    column: str
+
+    model_config = {"arbitrary_types_allowed": True}
+
+    def __init__(self, term: Union[str, UnboundTerm[Any]]):
+        if isinstance(term, Reference):
+            term_name = term.name
+        elif isinstance(term, str):
+            term_name = term
+        else:
+            raise ValueError("term must be a string or Reference")

Review Comment:
   We can use the helper `_to_unbound_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