Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-isaacs committed Nov 22, 2024
1 parent f997f1c commit 5b04445
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions datafusion/functions/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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()));
Expand Down

0 comments on commit 5b04445

Please sign in to comment.