shruti2522 commented on code in PR #17100:
URL: https://github.com/apache/datafusion/pull/17100#discussion_r2267712605


##########
datafusion/spark/src/function/utils.rs:
##########
@@ -65,43 +65,56 @@ pub mod test {
 
             match expected {
                 Ok(expected) => {
-                    let return_field = return_field.unwrap();
-                    assert_eq!(return_field.data_type(), &$EXPECTED_DATA_TYPE);
-
-                    let result = 
func.invoke_with_args(datafusion_expr::ScalarFunctionArgs{
-                        args: $ARGS,
-                        number_rows: cardinality,
-                        return_field,
-                        arg_fields: arg_fields.clone(),
-                        config_options: $CONFIG_OPTIONS,
-                    });
-                    assert_eq!(result.is_ok(), true, "function returned an 
error: {}", result.unwrap_err());
+                    if let Ok(return_field) = return_field {

Review Comment:
   simplified `result.is_ok() + unwrap()` to `if let Some(return_field) = 
return_field {`
   
   



-- 
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-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to