Copilot commented on code in PR #26824:
URL: https://github.com/apache/datafusion/pull/26824#discussion_r4395083355


##########
datafusion/datasource/src/source.rs:
##########
@@ -304,14 +304,52 @@ pub trait DataSource: Any + Send + Sync + Debug {
     ///
     /// [`PhysicalPlanNode`]: 
datafusion_proto_models::protobuf::PhysicalPlanNode
     #[cfg(feature = "proto")]
+    #[deprecated(since = "56.0.0", note = "implement `try_to_proto_source` 
instead")]
+    ///
+    /// The default wraps [`Self::try_to_proto_source`], so callers that still
+    /// forward to this hook on a migrated source get the layered node.
     fn try_to_proto(
         &self,
-        _ctx: &datafusion_physical_plan::proto::ExecutionPlanEncodeCtx<'_>,
+        ctx: &datafusion_physical_plan::proto::ExecutionPlanEncodeCtx<'_>,
     ) -> Result<Option<datafusion_proto_models::protobuf::PhysicalPlanNode>> {
+        Ok(self.try_to_proto_source(ctx)?.map(data_source_plan_node))

Review Comment:
   The deprecated encoder now emits a layered `DataSource` node, but 
`MemorySourceConfig::try_from_proto` still requires `MemoryScan`, so existing 
callers using that encode/decode pair fail with a variant error. The same 
mismatch affects the built-in file-source and sink pairs through 
`datafusion/datasource/src/file.rs:417–420` and 
`datafusion/datasource/src/sink.rs:92–94`. Make the deprecated decoders accept 
both their legacy and corresponding layered representations, and add 
compatibility tests that use the deprecated APIs on both sides.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to