File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -297,11 +297,20 @@ fn arrow_compare(
297297 let nullable = left. dtype ( ) . is_nullable ( ) || right. dtype ( ) . is_nullable ( ) ;
298298
299299 let array = if left. dtype ( ) . is_nested ( ) || right. dtype ( ) . is_nested ( ) {
300- let lhs = Datum :: try_new_array ( & left. to_canonical ( ) . into_array ( ) ) ?;
301- let ( lhs, _) = lhs. get ( ) ;
302300 let rhs = Datum :: try_new_array ( & right. to_canonical ( ) . into_array ( ) ) ?;
303301 let ( rhs, _) = rhs. get ( ) ;
304302
303+ // prefer the rhs data type since this is usually used in assert_eq!(actual, expect).
304+ let lhs = Datum :: with_target_datatype ( & left. to_canonical ( ) . into_array ( ) , rhs. data_type ( ) ) ?;
305+ let ( lhs, _) = lhs. get ( ) ;
306+
307+ assert ! (
308+ lhs. data_type( ) . equals_datatype( rhs. data_type( ) ) ,
309+ "lhs data_type: {}, rhs data_type: {}" ,
310+ lhs. data_type( ) ,
311+ rhs. data_type( )
312+ ) ;
313+
305314 let cmp = make_comparator ( lhs, rhs, SortOptions :: default ( ) ) ?;
306315 assert_eq ! ( lhs. len( ) , rhs. len( ) ) ;
307316 let len = lhs. len ( ) ;
You can’t perform that action at this time.
0 commit comments