From dc3fee662fdddc58b9f29e4bbf8f745f0995bf23 Mon Sep 17 00:00:00 2001 From: Joe Isaacs Date: Fri, 22 Nov 2024 10:12:59 +0000 Subject: [PATCH] fix --- datafusion/functions/src/utils.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/datafusion/functions/src/utils.rs b/datafusion/functions/src/utils.rs index 8b473500416b..9aa89f2428b5 100644 --- a/datafusion/functions/src/utils.rs +++ b/datafusion/functions/src/utils.rs @@ -149,7 +149,8 @@ pub mod test { let return_type = return_type.unwrap(); assert_eq!(return_type, $EXPECTED_DATA_TYPE); - let result = func.invoke_with_args(datafusion_expr::ScalarFunctionArgs{args: $ARGS, number_rows: cardinality, return_type: &return_type}); + #[allow(deprecated)] + let result = func.invoke_batch($ARGS, cardinality); assert_eq!(result.is_ok(), true, "function returned an error: {}", result.unwrap_err()); let result = result.unwrap().clone().into_array(cardinality).expect("Failed to convert to array"); @@ -170,7 +171,8 @@ pub mod test { } else { // invoke is expected error - cannot use .expect_err() due to Debug not being implemented - match func.invoke_with_args(datafusion_expr::ScalarFunctionArgs{args: $ARGS, number_rows: cardinality, return_type: &return_type.unwrap()}) { + #[allow(deprecated)] + match func.invoke_batch($ARGS, cardinality) { Ok(_) => assert!(false, "expected error"), Err(error) => { assert!(expected_error.strip_backtrace().starts_with(&error.strip_backtrace()));