Make SetPredicate and Subclasses JSON Serializable with Pydantic#2557
Make SetPredicate and Subclasses JSON Serializable with Pydantic#2557Fokko merged 21 commits intoapache:mainfrom
Conversation
Co-authored-by: Fokko Driesprong <fokko@apache.org>
Co-authored-by: Fokko Driesprong <fokko@apache.org>
|
@Fokko Thanks, for the feedback and correction . Please let me know if I need to do further improvements. |
|
@Aniketsy I've left a few more, but I think that should be it. We're super close! |
Co-authored-by: Fokko Driesprong <fokko@apache.org>
Co-authored-by: Fokko Driesprong <fokko@apache.org>
Co-authored-by: Fokko Driesprong <fokko@apache.org>
|
@Fokko Thanks! I’ve committed the suggested changes. |
Co-authored-by: Fokko Driesprong <fokko@apache.org>
Co-authored-by: Fokko Driesprong <fokko@apache.org>
Co-authored-by: Fokko Driesprong <fokko@apache.org>
Co-authored-by: Fokko Driesprong <fokko@apache.org>
|
@Fokko Thanks! Will run |
Co-authored-by: Fokko Driesprong <fokko@apache.org>
Co-authored-by: Fokko Driesprong <fokko@apache.org>
Co-authored-by: Fokko Driesprong <fokko@apache.org>
Co-authored-by: Fokko Driesprong <fokko@apache.org>
|
@Fokko I noticed the |
pyiceberg/expressions/__init__.py
Outdated
There was a problem hiding this comment.
This should be reverted:
| return NotIn[L](self.term, self.literals) | |
| return In[L](self.term, self.literals) |
pyiceberg/expressions/__init__.py
Outdated
There was a problem hiding this comment.
The class and init should be:
class SetPredicate(IcebergBaseModel, UnboundPredicate[L], ABC):
model_config = ConfigDict(arbitrary_types_allowed=True)
type: TypingLiteral["in", "not-in"] = Field(default="in")
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=_to_unbound_term(term), items=_to_literal_set(literals))|
@Aniketsy The suggestions above work on my end. Sorry for this issue, it is more complicated than I anticipated |
|
Thanks @Fokko , I’ve committed the changes based on your suggestions. Do I need to check ruff format from my end . |
|
I've just kicked off the CI. I think we also need to merge #2564 first |
|
Got it, thanks for triggering the CI. I’ll wait for #2564 to be merged. |
|
#2564 is merged, do you mind rebasing this PR? |
|
sure, i will do that. |
0cd1fb3 to
f922d17
Compare
|
@Fokko Could you please guide me on what I should do to get the test passing? |
perhaps this is an import issue. can you try |
|
Hi @kevinjqliu I’ve fixed the error. Could you please take a look? |
|
#2575 is merged, lets see if this can block the PR |
|
@Aniketsy I checked out the branch locally, and with the following changes the tests should pass: |
|
@Fokko Thanks! I’ve applied the changes as per your suggestions. |
|
Thank you for guiding, reviewing, and correcting me at each step throughout this PR . @Fokko @kevinjqliu |
|
With pleasure, thank you for contributing 🙌 |
#2524
This PR addresses issue by making the
SetPredicateclass and its subclasses (In, NotIn) JSON serializable using Pydantic.InandNotInpredicates.Please let me know if my approach or fix needs any improvements . I’m open to feedback and happy to make changes based on suggestions.
Thank you !