adriangb commented on code in PR #22471:
URL: https://github.com/apache/datafusion/pull/22471#discussion_r3294792970
##########
datafusion/physical-expr/src/lib.rs:
##########
@@ -40,6 +40,10 @@ mod partitioning;
mod physical_expr;
pub mod planner;
pub mod projection;
+/// Shared test helpers for the `try_to_proto` / `try_from_proto` migration
+/// (issue #22418). Compiled only under `cfg(test)` with the `proto` feature.
Review Comment:
```suggestion
/// Shared test helpers for the `try_to_proto` / `try_from_proto` unit tests
```
##########
datafusion/physical-expr/src/expressions/like.rs:
##########
@@ -283,3 +346,192 @@ mod test {
Ok(())
}
}
+
+/// Tests for the `try_to_proto` / `try_from_proto` hooks (issue #22418).
+///
+/// These drive the encode/decode hooks directly with small stub
+/// encoder/decoders so every branch can be covered without depending on
+/// `datafusion-proto`: the happy path, the wrong-node and missing-child
+/// rejections, and child encode/decode error propagation.
Review Comment:
```suggestion
/// Tests for the `try_to_proto` / `try_from_proto` hooks.
```
##########
datafusion/physical-expr/src/proto_test_util.rs:
##########
@@ -0,0 +1,148 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! Shared test helpers for exercising the `try_to_proto` / `try_from_proto`
+//! hooks (issue #22418) without depending on `datafusion-proto`.
+//!
+//! As built-in expressions are ported off the central proto downcast chain,
+//! each one's unit tests need to drive the new encode/decode hooks in
+//! isolation. The generic scaffolding — stub encoder/decoders and a
+//! placeholder child-node builder — lives here so it is written once and
+//! reused across expressions. Expression-specific node builders and fixtures
+//! stay in each expression's own test module.
Review Comment:
```suggestion
//! Shared test helpers for proto serialization / deserialization in
expression unit tests
//! without depending on `datafusion-proto` (which would create circular
deps).
```
--
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]