You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/12/06 23:10:16 UTC

[GitHub] [arrow-datafusion] alamb commented on a change in pull request #1376: Make tests for `simplify` and `Simplifer` consistent

alamb commented on a change in pull request #1376:
URL: https://github.com/apache/arrow-datafusion/pull/1376#discussion_r763478322



##########
File path: datafusion/src/optimizer/simplify_expressions.rs
##########
@@ -1632,18 +1525,22 @@ mod tests {
         \n      TableScan: test projection=None";
 
         assert_optimized_plan_eq(&plan, expected);
-        Ok(())
     }
 
     #[test]
-    fn test_simplity_optimized_plan_not_eq_expr() -> Result<()> {
-        let table_scan = test_table_scan()?;
+    fn test_simplity_optimized_plan_not_eq_expr() {
+        let table_scan = test_table_scan();
         let plan = LogicalPlanBuilder::from(table_scan)
-            .filter(col("b").not_eq(lit(true)))?
-            .filter(col("c").not_eq(lit(false)))?
-            .limit(1)?
-            .project(vec![col("a")])?
-            .build()?;
+            .filter(col("b").not_eq(lit(true)))
+            .unwrap()

Review comment:
       It helps me more easily find the source of the problem -- by using `unwap()` whenever an error happens, you can set `RUST_BACKTRACE=1` and know exactly at what site the problem happened. If the tests return `Error`, often the `Error` does not have sufficient context to know exactly where it was generated.  




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org