refactor: mark the ExecutionPlan proto dispatch traits as non-public API - #24001
Merged
Conversation
`ExecutionPlanEncode` / `ExecutionPlanDecode` are dispatch details of the `try_to_proto` / `try_from_proto` hooks, not extension points: they are defined in `datafusion-physical-plan`, implemented only by the converter adapters in `datafusion-proto`, and reached by plans exclusively through `ExecutionPlanEncodeCtx` / `ExecutionPlanDecodeCtx`. They are `pub` only because those adapters live in another crate. Nothing said so to the tooling, so every ctx capability the epic still has to add counts as a major breaking change. Mark both `#[doc(hidden)]`, which is what they already were in intent, and say why in their docs. `cargo-semver-checks` then treats later `encode_*` / `decode_*` additions as what they are: changes to something that was never public API. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
adriangb
force-pushed
the
seal-plan-dispatch-traits
branch
from
July 30, 2026 14:15
c6df4fd to
e36e9b6
Compare
Contributor
Author
|
@kumarUjjawal small change I found while working on our EPIC, please take a look when you can 🙏🏻 |
|
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 |
adriangb
enabled auto-merge
July 30, 2026 14:42
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #24001 +/- ##
==========================================
+ Coverage 80.75% 80.85% +0.09%
==========================================
Files 1096 1096
Lines 373588 373911 +323
Branches 373588 373911 +323
==========================================
+ Hits 301687 302311 +624
+ Misses 53898 53557 -341
- Partials 18003 18043 +40 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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?
DataSource/DataSinkitems, Proto: add DataSource/FileSource try_to_proto hook + port FileScanConfig serde #23497 / Proto: add DataSink try_to_proto hook + port FileSinkConfig serde #23498).Rationale for this change
ExecutionPlanEncode/ExecutionPlanDecode(added in #23495) are dispatch details of thetry_to_proto/try_from_protohooks, not extension points. They are defined indatafusion-physical-plan, implemented only byConverterPlanEncoder/ConverterPlanDecoderin
datafusion-proto, and plans reach them exclusively throughExecutionPlanEncodeCtx/ExecutionPlanDecodeCtx— their own docs already say so:They are
pubonly because those adapters live in another crate. Nothing said that to the tooling,so every capability the epic still has to add to the ctx reads as a major breaking change. #23915
hits this first: it needs
decode_plan_with_scalar_subquery_resultssoScalarSubqueryExeccandecode its input with the subquery-results container in scope, and
cargo-semver-checksflags therequired method as
trait_method_added. TheDataSource/DataSinkfamilies will want their ownprimitives next.
#[doc(hidden)]states what was already true, and makes those additions changes to something thatwas never public API — rather than asking each follow-up PR to explain away a breakage report.
What changes are included in this PR?
Mark
ExecutionPlanEncodeandExecutionPlanDecode#[doc(hidden)], and say why in their docsand in the module overview. One file, no behavior, wire-format, or signature changes.
A sealed-trait supertrait was the first thing I tried. It is worse here: sealing across a crate
boundary needs a
pubmarker anyway, so it does not actually prevent a downstream impl — it justadds a public item in order to say "this is not public API", plus an
implline for everyimplementor including test doubles.
#[doc(hidden)]says the same thing by removing API surfaceinstead of adding it, and
cargo-semver-checkshonors both identically (measured below).Are these changes tested?
The property this PR buys is a
cargo-semver-checksclassification, so it is verified with thattool directly — v0.49.0, the version CI installs, invoked the way CI invokes it:
mainExecutionPlanDecodetrait_method_added— majorWorth recording, since it drove the shape of this PR: the lint reads
public_api_sealedfrom thebaseline, so this has to land before the PRs that add methods, not alongside them. Also,
cargo-semver-checksdoes not re-qualify the traits as public API even thoughExecutionPlanEncodeCtx::newstill names them in a public signature.Also ran, on the pinned 1.97.0 toolchain:
cargo fmt --all -- --check,cargo clippy --all-targets --all-featuresfor both crates,cargo docwith-D warnings(no broken intra-doc links from themodule docs to the now-hidden traits), and the full
datafusion-protointegration suite(211 passed).
Are there any user-facing changes?
cargo-semver-checkswill reporttrait_now_doc_hiddenon this PR, and that is the intendedcontent of the change.
Real-world impact is nil: both traits were introduced by #23495, which merged after
54.1.0wastagged, so no released version of
datafusion-physical-plancontains them. The load-bearing publicAPI —
ExecutionPlan::try_to_proto, the two ctx types,AsExecutionPlan,PhysicalExtensionCodec,PhysicalProtoConverterExtension— is untouched, anddatafusion-protoneeds no change at all.Note for contributors on #23494: the expression-side equivalents (
PhysicalExprEncode/PhysicalExprDecodeinphysical-expr-common) have the same shape and the same argument, butseveral test doubles across crates implement them. Left for a follow-up.