Skip to content

refactor: port InListExpr to use try_to_proto/try_from_proto hooks#22503

Open
kkrainov wants to merge 1 commit into
apache:mainfrom
kkrainov:kkrainov/22425-inlist-proto-refactor
Open

refactor: port InListExpr to use try_to_proto/try_from_proto hooks#22503
kkrainov wants to merge 1 commit into
apache:mainfrom
kkrainov:kkrainov/22425-inlist-proto-refactor

Conversation

@kkrainov
Copy link
Copy Markdown

Which issue does this PR close?

Rationale for this change

This PR migrates InListExpr to use the new try_to_proto and try_from_proto hooks, following the modular serialization architecture established in #21835 . This moves serialization logic into the expression itself, improving encapsulation and decentralizing the datafusion-proto logic as part of the broader effort in #22418

What changes are included in this PR?

  • Implemented PhysicalExpr::try_to_proto for InListExpr.
  • Implemented InListExpr::try_from_proto inherent method.
  • Wired hooks in from_proto.rs and removed the central downcast arm in to_proto.rs.
  • Added isolated unit tests in in_list.rs using mock drivers to verify roundtrips and error handling.

Are these changes tested?

Yes, these changes are covered by both new and existing tests:

  • New Unit Tests: Added mod proto_tests to in_list.rs using mock drivers to verify try_to_proto and try_from_proto in isolation. These cover successful roundtrips, incorrect node types, and missing required fields.
  • Existing Integration Tests: Verified that the existing InList roundtrip tests in datafusion-proto continue to pass after removing the central downcast logic.
  • Linting: Verified that the changes pass cargo clippy --all-targets --all-features with zero warnings.

Are there any user-facing changes?

No.

@github-actions github-actions Bot added physical-expr Changes to the physical-expr crates proto Related to proto crate labels May 24, 2026
- Implement PhysicalExpr::try_to_proto for InListExpr
- Implement InListExpr::try_from_proto inherent method
- Wire hooks in from_proto.rs and remove legacy logic in to_proto.rs
- Add comprehensive unit tests with mocks to verify hooks in isolation
- Pass all unit and integration tests with clean clippy
@kkrainov kkrainov force-pushed the kkrainov/22425-inlist-proto-refactor branch from 275a2c4 to ba148c1 Compare May 24, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-expr Changes to the physical-expr crates proto Related to proto crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port InListExpr to use try_to_proto / try_from_proto

1 participant