44use std:: fmt:: Display ;
55
66use itertools:: Itertools ;
7+ use vortex_error:: VortexExpect ;
78
89use crate :: ArrayRef ;
910use crate :: DynArray ;
@@ -21,12 +22,13 @@ fn format_indices<I: IntoIterator<Item = usize>>(indices: I) -> impl Display {
2122fn execute_to_canonical ( array : ArrayRef , ctx : & mut ExecutionCtx ) -> ArrayRef {
2223 array
2324 . execute :: < RecursiveCanonical > ( ctx)
24- . expect ( "failed to execute array to recursive canonical form" )
25+ . vortex_expect ( "failed to execute array to recursive canonical form" )
2526 . 0
2627 . into_array ( )
2728}
2829
2930/// Finds indices where two arrays differ based on `scalar_at` comparison.
31+ #[ expect( clippy:: unwrap_used) ]
3032fn find_mismatched_indices ( left : & ArrayRef , right : & ArrayRef ) -> Vec < usize > {
3133 assert_eq ! ( left. len( ) , right. len( ) ) ;
3234 ( 0 ..left. len ( ) )
@@ -74,6 +76,8 @@ macro_rules! assert_nth_scalar_is_null {
7476#[ macro_export]
7577macro_rules! assert_arrays_eq {
7678 ( $left: expr, $right: expr) => { {
79+ let left = $left. clone( ) ;
80+ let right = $right. clone( ) ;
7781 assert_eq!(
7882 left. dtype( ) ,
7983 right. dtype( ) ,
@@ -95,9 +99,9 @@ macro_rules! assert_arrays_eq {
9599 ) ;
96100
97101 #[ allow( deprecated) ]
98- let left = $ left. to_array( ) ;
102+ let left = left. to_array( ) ;
99103 #[ allow( deprecated) ]
100- let right = $ right. to_array( ) ;
104+ let right = right. to_array( ) ;
101105 $crate:: arrays:: assert_arrays_eq_impl( & left, & right) ;
102106 } } ;
103107}
0 commit comments