Skip to content

Conversation

@Aniketsy
Copy link
Contributor

#2522

This PR makes the UnaryPredicate class and its subclasses (IsNull, NotNull, IsNaN, NotNaN) JSON serializable using Pydantic

  • Adds unit tests to verify JSON serialization for IsNull and NotNull

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.
Thankyou !

@Aniketsy Aniketsy force-pushed the make-unarypredicate-json-serializable branch from ad99ec8 to 9d333ee Compare October 18, 2025 08:28
@Aniketsy
Copy link
Contributor Author

@Fokko please review these changes , when you get a chance.

@Aniketsy Aniketsy force-pushed the make-unarypredicate-json-serializable branch from 4096627 to 9c9b3c4 Compare October 20, 2025 08:50
Co-authored-by: Fokko Driesprong <fokko@apache.org>
@Aniketsy
Copy link
Contributor Author

@Fokko While testing locally, I’m getting 15 test failures, but in the CI check, there’s only 1 test failing. Could you please help me understand what might be causing this difference?

@Fokko
Copy link
Contributor

Fokko commented Oct 21, 2025

@Aniketsy Sure thing, I'm happy to. Could you share the output of the console?

@Aniketsy
Copy link
Contributor Author

sure,

=================== short test summary info ===================
FAILED tests/expressions/test_expressions.py::test_reference - AttributeError: 'Reference' object has no attribute 'model_...   
FAILED tests/expressions/test_expressions.py::test_always_true - AttributeError: 'AlwaysTrue' object has no attribute 'model... 
FAILED tests/expressions/test_expressions.py::test_always_false 
- AttributeError: 'AlwaysFalse' object has no attribute 'mode...FAILED tests/expressions/test_expressions.py::test_serialize_is_null - AttributeError: 'IsNull' object has no attribute 'model_dum...
FAILED tests/expressions/test_expressions.py::test_serialize_not_null - AttributeError: 'NotNull' object has no attribute 'model_du...
FAILED tests/expressions/test_expressions.py::test_serialize_in 
- AttributeError: 'In' object has no attribute 'model_dump_json'FAILED tests/expressions/test_expressions.py::test_serialize_not_in - AttributeError: 'NotIn' object has no attribute 'model_dump...
FAILED tests/expressions/test_expressions.py::test_equal_to - AttributeError: 'EqualTo' object has no attribute 'model_du...    
FAILED tests/expressions/test_expressions.py::test_not_equal_to 
- AttributeError: 'NotEqualTo' object has no attribute 'model...FAILED tests/expressions/test_expressions.py::test_greater_than_or_equal_to - AttributeError: 'GreaterThanOrEqual' object has no attribut...
FAILED tests/expressions/test_expressions.py::test_greater_than 
- AttributeError: 'GreaterThan' object has no attribute 'mode...FAILED tests/expressions/test_expressions.py::test_less_than - AttributeError: 'LessThan' object has no attribute 'model_d...   
FAILED tests/expressions/test_expressions.py::test_less_than_or_equal - AttributeError: 'LessThanOrEqual' object has no attribute '...
FAILED tests/expressions/test_expressions.py::test_starts_with - AttributeError: 'StartsWith' object has no attribute 'model... 
FAILED tests/expressions/test_expressions.py::test_not_starts_with - AttributeError: 'NotStartsWith' object has no attribute 'mo...
=============== 15 failed, 145 passed in 1.65s 

Co-authored-by: Fokko Driesprong <fokko@apache.org>
Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one @Aniketsy! This looks good to me 👍

@Fokko Fokko merged commit 924ee73 into apache:main Oct 22, 2025
8 checks passed
@Aniketsy
Copy link
Contributor Author

@Fokko Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants