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


##########
pyiceberg/expressions/__init__.py:
##########
@@ -559,12 +561,19 @@ def as_bound(self) -> Type[BoundNotNaN[L]]:
         return BoundNotNaN[L]
 
 
-class SetPredicate(UnboundPredicate[L], ABC):
-    literals: Set[Literal[L]]
+class SetPredicate(UnboundPredicate[L], IcebergBaseModel, ABC):
+    type: str = Field(default="in", alias="type")
+    term: str
+    literals: Set[Literal[L]] = Field(alias="items")
 
     def __init__(self, term: Union[str, UnboundTerm[Any]], literals: 
Union[Iterable[L], Iterable[Literal[L]]]):
-        super().__init__(term)
-        self.literals = _to_literal_set(literals)
+        # Convert term to string for serialization
+        term_str = term.name if isinstance(term, Reference) else str(term)
+        literals_set = _to_literal_set(literals)
+        value_list = [lit.value for lit in literals_set]
+        super().__init__(term=term_str, value=value_list)
+        self.literals = literals_set
+        self.term_obj = term 

Review Comment:
   With the latest changes, I think we can revert this part 👍 
   ```suggestion
           super().__init__(term)
           self.literals = _to_literal_set(literals)
   ```



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