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