mingmwang commented on code in PR #6084:
URL: https://github.com/apache/arrow-datafusion/pull/6084#discussion_r1177514606


##########
datafusion/optimizer/src/test/mod.rs:
##########
@@ -134,6 +134,25 @@ pub fn assert_analyzed_plan_eq_display_indent(
 
     Ok(())
 }
+
+pub fn assert_analyzer_check_err(
+    rules: Vec<Arc<dyn AnalyzerRule + Send + Sync>>,
+    plan: &LogicalPlan,
+    expected: &str,
+) {
+    let options = ConfigOptions::default();
+    let analyzed_plan =
+        Analyzer::with_rules(rules).execute_and_check(plan, &options, |_, _| 
{});
+    match analyzed_plan {
+        Ok(plan) => assert_eq!(format!("{}", plan.display_indent()), "An 
error"),
+        Err(ref e) => {
+            let actual = format!("{e}");
+            if expected.is_empty() || !actual.contains(expected) {
+                assert_eq!(actual, expected)
+            }
+        }

Review Comment:
   Done



-- 
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]

Reply via email to