Skip to content

Commit e05de25

Browse files
adriangbclaude
andcommitted
Re-export moved proto types under deprecated paths
The proto-models extraction moved the prost-generated types from `datafusion_proto::generated::*` into `datafusion_proto_models::generated::*`. cargo-semver-checks flagged ~200 paths as removed, even though my `pub use datafusion_proto_models::protobuf::*` wildcard re-export should have covered them — turns out wildcard-of-wildcard re-exports aren't followed by every static-analysis tool. Two fixes: 1. `pub mod protobuf` now re-exports directly from `datafusion_proto_models::generated::datafusion::*` (the leaf module where the types are originally declared) instead of going through `datafusion_proto_models::protobuf::*` (itself a `pub use ::*`). One level of indirection avoided. 2. New `pub mod generated` re-exports the legacy `generated::datafusion::*` and `generated::datafusion_common` paths, with `#[deprecated]` pointing downstream callers at `datafusion_proto::protobuf` / `datafusion_proto_common::protobuf_common`. Together: every `datafusion_proto::generated::*` and `datafusion_proto::protobuf::*` path that compiled on `main` continues to compile, with deprecation warnings on the legacy `generated::*` paths. The other API breaks (`PhysicalPlanNodeExt` trait import for inherent- looking methods, `from_proto`/`try_from_proto` over `From`/`TryFrom` for foreign-foreign pairs) can't be made backwards-compatible without re-introducing the orphan rule problem; they're flagged in the PR description. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 15c706e commit e05de25

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

datafusion/proto/src/lib.rs

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,40 @@ pub mod protobuf {
137137
ScalarValue, Schema,
138138
};
139139
pub use datafusion_proto_common::{FromProtoError, ToProtoError};
140-
pub use datafusion_proto_models::protobuf::*;
140+
// Re-export every type from `datafusion-proto-models`'s generated module
141+
// so the existing `datafusion_proto::protobuf::Foo` paths keep resolving.
142+
// Going through the deeper `generated::datafusion` path (rather than
143+
// `datafusion_proto_models::protobuf`, which is itself a `pub use ::*`)
144+
// avoids a double wildcard re-export that some tools (cargo-semver-checks)
145+
// don't follow.
146+
pub use datafusion_proto_models::generated::datafusion::*;
147+
}
148+
149+
/// Backwards-compatible re-export of the moved generated types.
150+
///
151+
/// The prost-generated structs now live in `datafusion-proto-models`;
152+
/// this module preserves the legacy `datafusion_proto::generated::*` paths
153+
/// for downstream callers. Prefer the [`protobuf`] module (or
154+
/// [`datafusion_proto_models`] directly) in new code.
155+
#[deprecated(
156+
since = "53.1.0",
157+
note = "use `datafusion_proto::protobuf` (or `datafusion_proto_models::protobuf`) instead"
158+
)]
159+
pub mod generated {
160+
/// Re-export of the prost-generated types defined in `datafusion.proto`.
161+
#[deprecated(
162+
since = "53.1.0",
163+
note = "use `datafusion_proto::protobuf` (or `datafusion_proto_models::protobuf`) instead"
164+
)]
165+
pub use datafusion_proto_models::generated::datafusion;
166+
167+
/// Re-export of the prost-generated common types defined in
168+
/// `datafusion_common.proto`.
169+
#[deprecated(
170+
since = "53.1.0",
171+
note = "use `datafusion_proto_common::protobuf_common` instead"
172+
)]
173+
pub use datafusion_proto_models::generated::datafusion_common;
141174
}
142175

143176
#[cfg(doctest)]

0 commit comments

Comments
 (0)