fix(proto): preserve physical cast expression state - #25056
Open
buraksenn wants to merge 2 commits into
Open
Conversation
buraksenn
marked this pull request as draft
September 8, 2026 09:10
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #25056 +/- ##
==========================================
- Coverage 81.74% 81.69% -0.06%
==========================================
Files 1128 1128
Lines 416645 417391 +746
Branches 416645 417391 +746
==========================================
+ Hits 340580 340974 +394
- Misses 55998 56349 +351
- Partials 20067 20068 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
buraksenn
marked this pull request as ready for review
September 8, 2026 16:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
Physical cast protobuf hooks did not serialize
CastExproptions or explicit target-field metadata. A round trip could therefore change cast behavior, nullability, or metadata. The hooks also accessed fields individually, so future fields could be omitted silently.What changes are included in this PR?
CastExpr,TryCastExpr, and their protobuf messages.CASTandTRY_CASTwhile keeping legacy type-only payload behavior.CastExpr::cast_optionsAPI adjustment.The protobuf changes are additive and backward compatible.
What is the testing strategy for this PR?
Added unit coverage for:
Validated with:
cargo test -p datafusion-physical-expr --features proto expressions::cast::cargo test -p datafusion-physical-expr --features proto expressions::try_cast::cargo clippy -p datafusion-physical-expr -p datafusion-physical-expr-adapter --all-features --tests -- -D warningscargo check -p datafusion-proto --all-features./ci/scripts/doc_prettier_check.sh --write --allow-dirtyAre there any user-facing changes?
Cast expressions now retain their options and explicit output-field semantics across protobuf round trips.
CastExpr::cast_options()returns a borrowingCastOptions<'_>value rather than&CastOptions<'static>; the upgrade guide documents migration for code rebuilding casts.