Copilot commented on code in PR #15937:
URL: https://github.com/apache/datafusion/pull/15937#discussion_r2072657169
##########
datafusion/optimizer/src/test/mod.rs:
##########
@@ -242,6 +226,24 @@ pub fn assert_optimized_plan_eq_display_indent(
assert_eq!(formatted_plan, expected);
}
+#[macro_export]
+macro_rules! assert_optimized_plan_eq_display_indent_snapshot {
+ (
+ $rule:expr,
+ $plan:expr,
+ @ $expected:literal $(,)?
+ ) => {{
+ let optimizer = $crate::Optimizer::with_rules(vec![$rule]);
+ let optimized_plan = optimizer
+ .optimize($plan, &$crate::OptimizerContext::new(), |_, _| {})
+ .expect("failed to optimize plan");
Review Comment:
[nitpick] Consider adding inline documentation to clarify that
display_indent_schema() is used for snapshot formatting and to highlight any
differences compared to the previous formatting strategy.
```suggestion
.expect("failed to optimize plan");
// Use `display_indent_schema()` to format the optimized plan for
snapshot testing.
// This method includes schema information in the output, making it
suitable for detailed comparisons.
```
--
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]