Fokko commented on code in PR #2561:
URL: https://github.com/apache/iceberg-python/pull/2561#discussion_r2412833622
##########
pyiceberg/expressions/__init__.py:
##########
@@ -725,12 +729,37 @@ def as_bound(self) -> Type[BoundNotIn[L]]:
return BoundNotIn[L]
-class LiteralPredicate(UnboundPredicate[L], ABC):
- literal: Literal[L]
+class LiteralPredicate(IcebergBaseModel, UnboundPredicate[L], ABC):
+ op: str = Field(
+ default="",
+ alias="type",
+ validation_alias="type",
+ serialization_alias="type",
+ repr=False,
+ )
Review Comment:
I don't like the enum as it is way too verbose. Interesting that the
`Literal` isn't working, it seems to work in
https://github.com/apache/iceberg-python/pull/2557.
Could you at least clean up the PR? Storing it directly in `type`, rather
than `op` removes a lot of the complexity:
```suggestion
type: str = Field()
```
I think below we can also remove the `field_serializer` for the `type` field
then.
--
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]