You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "koopatroopa787 (via GitHub)" <gi...@apache.org> on 2026/05/30 01:41:57 UTC

[PR] feat(physical-expr): port TryCastExpr to try_to_proto / try_from_proto hooks [datafusion]

koopatroopa787 opened a new pull request, #22637:
URL: https://github.com/apache/datafusion/pull/22637

   ## Which issue does this PR close?
   
   Closes #22429
   
   ## Rationale for this change
   
   `TryCastExpr` serialization/deserialization lived in the central downcast chains in `to_proto.rs` and `from_proto.rs`. This PR moves it into self-contained `try_to_proto` / `try_from_proto` hooks on `TryCastExpr` itself, following the pattern established for `NotExpr`, `NegativeExpr`, `IsNullExpr`, `IsNotNullExpr`, and `Literal`.
   
   ## What changes are included in this PR?
   
   - `datafusion/physical-expr/src/expressions/try_cast.rs`
     - Added `#[cfg(feature = "proto")] fn try_to_proto(...)` inside `impl PhysicalExpr for TryCastExpr`
     - Added `#[cfg(feature = "proto")] impl TryCastExpr { pub fn try_from_proto(...) }`
     - Added `proto_tests` module covering: encode, encode-error propagation, decode, reject-wrong-variant, missing-expr, missing-arrow-type, and decode-error propagation
   - `datafusion/proto/src/physical_plan/to_proto.rs`
     - Removed the `TryCastExpr` downcast arm; removed `TryCastExpr` from import list
   - `datafusion/proto/src/physical_plan/from_proto.rs`
     - Replaced the inline `ExprType::TryCast` arm with `TryCastExpr::try_from_proto(proto, &decode_ctx)?`
   
   ## Are there any user-facing changes?
   
   No. Serialization behaviour is identical; only the code location changed.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] feat(physical-expr): port TryCastExpr to try_to_proto / try_from_proto hooks [datafusion]

Posted by "koopatroopa787 (via GitHub)" <gi...@apache.org>.
koopatroopa787 closed pull request #22637: feat(physical-expr): port TryCastExpr to try_to_proto / try_from_proto hooks
URL: https://github.com/apache/datafusion/pull/22637


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] feat(physical-expr): port TryCastExpr to try_to_proto / try_from_proto hooks [datafusion]

Posted by "koopatroopa787 (via GitHub)" <gi...@apache.org>.
koopatroopa787 commented on PR #22637:
URL: https://github.com/apache/datafusion/pull/22637#issuecomment-4614134992

   Closing — #22550 was merged to main which already ports TryCastExpr to try_to_proto/try_from_proto hooks. This PR is now superseded.


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org