Fokko commented on code in PR #2557:
URL: https://github.com/apache/iceberg-python/pull/2557#discussion_r2399936230
##########
pyiceberg/expressions/__init__.py:
##########
@@ -42,6 +42,8 @@
from pyiceberg.typedef import L, StructProtocol
from pyiceberg.types import DoubleType, FloatType, NestedField
from pyiceberg.utils.singleton import Singleton
+from pyiceberg.typedef import IcebergBaseModel
+from pydantic import Field
Review Comment:
```suggestion
from pydantic import Field
from typing import Literal as TypingLiteral
```
##########
pyiceberg/expressions/__init__.py:
##########
@@ -698,6 +703,8 @@ def as_bound(self) -> Type[BoundIn[L]]:
class NotIn(SetPredicate[L], ABC):
+ type: str = Field(default="not-in", alias="type")
Review Comment:
```suggestion
type: TypingLiteral["not-in"] = Field(default="not-in", alias="type")
```
##########
pyiceberg/expressions/__init__.py:
##########
@@ -559,8 +561,9 @@ 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")
Review Comment:
```suggestion
type: TypingLiteral["in", "not-in"] = Field(default="in", alias="type")
```
##########
pyiceberg/expressions/__init__.py:
##########
@@ -676,6 +679,8 @@ def as_unbound(self) -> Type[NotIn[L]]:
class In(SetPredicate[L]):
+ type: Literal["in"] = Field(default="in", alias="type")
Review Comment:
```suggestion
type: TypingLiteral["in"] = Field(default="in", alias="type")
```
--
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]