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

tustvold pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new ff013e245 minor: improve error style (#5510)
ff013e245 is described below

commit ff013e24559850541c54cf5d254922649ef37d8c
Author: Andrew Lamb <[email protected]>
AuthorDate: Thu Mar 9 00:41:14 2023 +0100

    minor: improve error style (#5510)
---
 datafusion/core/tests/simplification.rs                  | 5 +----
 datafusion/optimizer/src/simplify_expressions/context.rs | 5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/datafusion/core/tests/simplification.rs 
b/datafusion/core/tests/simplification.rs
index f6b944b50..434a0ddbf 100644
--- a/datafusion/core/tests/simplification.rs
+++ b/datafusion/core/tests/simplification.rs
@@ -51,10 +51,7 @@ impl SimplifyInfo for MyInfo {
     }
 
     fn get_data_type(&self, expr: &Expr) -> Result<DataType> {
-        match expr.get_type(&self.schema) {
-            Ok(expr_data_type) => Ok(expr_data_type),
-            Err(e) => Err(e),
-        }
+        expr.get_type(&self.schema)
     }
 }
 
diff --git a/datafusion/optimizer/src/simplify_expressions/context.rs 
b/datafusion/optimizer/src/simplify_expressions/context.rs
index b6e3f07b2..0fe1e6ae8 100644
--- a/datafusion/optimizer/src/simplify_expressions/context.rs
+++ b/datafusion/optimizer/src/simplify_expressions/context.rs
@@ -129,10 +129,7 @@ impl<'a> SimplifyInfo for SimplifyContext<'a> {
     /// Returns data type of this expr needed for determining optimized int 
type of a value
     fn get_data_type(&self, expr: &Expr) -> Result<DataType> {
         if self.schemas.len() == 1 {
-            match expr.get_type(&self.schemas[0]) {
-                Ok(expr_data_type) => Ok(expr_data_type),
-                Err(e) => Err(e),
-            }
+            expr.get_type(&self.schemas[0])
         } else {
             Err(DataFusionError::Internal(
                 "The expr has more than one schema, could not determine data 
type"

Reply via email to