iceberg-python
iceberg-python copied to clipboard
Make `and` expression JSON serializable
Feature Request / Improvement
Make sure that the and expression can be serialized to JSON:
https://github.com/apache/iceberg-python/blob/e5e74534a4938fcace2c782a237474b7e94da68c/pyiceberg/expressions/init.py#L250
This should follow:
{
"type": "and",
"left": BooleanExpression,
"right": BooleanExpression
}
Where BooleanExpression refers to the class:
https://github.com/apache/iceberg-python/blob/e5e74534a4938fcace2c782a237474b7e94da68c/pyiceberg/expressions/init.py#L250
We use Pydantic for JSON serialization, which can be enabled by deriving from the IcebergBaseModel:
https://github.com/apache/iceberg-python/blob/e5e74534a4938fcace2c782a237474b7e94da68c/pyiceberg/partitioning.py#L124
Example tests can be found here:
https://github.com/apache/iceberg-python/blob/e5e74534a4938fcace2c782a237474b7e94da68c/tests/table/test_partitioning.py#L116-L132
Hi @Fokko, can work on this issue?
hey @tanmayrauth normally i would say please feel free to submit a PR. But for this one, it looks like Fokko might have created it specifically for "PyData Amsterdam 2025" which i think is right now.
So lets wait a bit and see if this is already taken
@tanmayrauth Indeed, as @kevinjqliu is saying, this is staged for the open source sprints for PyData Amsterdam. After today, I'll delete the label, and everyone is welcome to jump in :)
I've removed the label and this one is up for grabs. Keep in min that this issue requires BooleanExpression to extend IcebergBaseModel, so it would be good to get the unary/literal/set predicates in first.
@kevinjqliu Can I pick this up?
hey @tanmayrauth feel free to submit a PR for this one (and other ones too)! Generally the issues are first come first serve. You dont need permission to work on something :) We just want to make sure that there's no duplicate effort from multiple people