This is an automated email from the ASF dual-hosted git repository.

sunchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 67baa1e  ARROW-4896: [Rust] [DataFusion] Remove all uses of panic! 
from DataFusion tests
67baa1e is described below

commit 67baa1e097d1bdf85a7ba6789f388b5aa188a741
Author: Andy Grove <[email protected]>
AuthorDate: Fri Mar 15 13:00:32 2019 -0700

    ARROW-4896: [Rust] [DataFusion] Remove all uses of panic! from DataFusion 
tests
    
    Author: Andy Grove <[email protected]>
    
    Closes #3918 from andygrove/ARROW-4896 and squashes the following commits:
    
    67c49ac6 <Andy Grove> formatting
    de19dd37 <Andy Grove> fix typo
    674d5149 <Andy Grove> Remove all uses of panic! from DataFusion tests
---
 rust/datafusion/src/datasource/memory.rs              | 7 +++++--
 rust/datafusion/src/optimizer/projection_push_down.rs | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/rust/datafusion/src/datasource/memory.rs 
b/rust/datafusion/src/datasource/memory.rs
index ebebd4e..e5955e5 100644
--- a/rust/datafusion/src/datasource/memory.rs
+++ b/rust/datafusion/src/datasource/memory.rs
@@ -232,7 +232,7 @@ mod tests {
             Err(ExecutionError::General(e)) => {
                 assert_eq!("\"Projection index out of range\"", 
format!("{:?}", e))
             }
-            _ => panic!("Scan should failed on invalid projection"),
+            _ => assert!(false, "Scan should failed on invalid projection"),
         };
     }
 
@@ -265,7 +265,10 @@ mod tests {
                 "\"Mismatch between schema and batches\"",
                 format!("{:?}", e)
             ),
-            _ => panic!("MemTable::new should have failed due to schema 
mismatch"),
+            _ => assert!(
+                false,
+                "MemTable::new should have failed due to schema mismatch"
+            ),
         }
     }
 }
diff --git a/rust/datafusion/src/optimizer/projection_push_down.rs 
b/rust/datafusion/src/optimizer/projection_push_down.rs
index a9d2787..2ffdfc9 100644
--- a/rust/datafusion/src/optimizer/projection_push_down.rs
+++ b/rust/datafusion/src/optimizer/projection_push_down.rs
@@ -389,9 +389,9 @@ mod tests {
                 LogicalPlan::TableScan { ref schema, .. } => {
                     assert_eq!(2, schema.fields().len());
                 }
-                _ => panic!(),
+                _ => assert!(false),
             },
-            _ => panic!(),
+            _ => assert!(false),
         }
     }
 

Reply via email to