@@ -113,12 +113,15 @@ pub fn take(array: impl AsRef<Array>, indices: impl AsRef<Array>) -> VortexResul
113
113
#[ cfg( debug_assertions) ]
114
114
{
115
115
// If either the indices or the array are nullable, the result should be nullable.
116
- let expected_nullability =
117
- ( indices. dtype ( ) . is_nullable ( ) || array. dtype ( ) . is_nullable ( ) ) . into ( ) ;
116
+ let expected_nullability = indices. dtype ( ) . nullability ( ) | array. dtype ( ) . nullability ( ) ;
118
117
assert_eq ! (
119
118
taken. dtype( ) ,
120
119
& array. dtype( ) . with_nullability( expected_nullability) ,
121
- "Take result should be nullable if either the indices or the array are nullable"
120
+ "Take result ({}) should be nullable if either the indices ({}) or the array ({}) are nullable. ({})" ,
121
+ taken. dtype( ) ,
122
+ indices. dtype( ) . nullability( ) . verbose_display( ) ,
123
+ array. dtype( ) . nullability( ) . verbose_display( ) ,
124
+ array. encoding( ) ,
122
125
) ;
123
126
}
124
127
@@ -136,12 +139,15 @@ pub fn take_into(
136
139
#[ cfg( debug_assertions) ]
137
140
{
138
141
// If either the indices or the array are nullable, the result should be nullable.
139
- let expected_nullability =
140
- ( indices. dtype ( ) . is_nullable ( ) || array. dtype ( ) . is_nullable ( ) ) . into ( ) ;
142
+ let expected_nullability = indices. dtype ( ) . nullability ( ) | array. dtype ( ) . nullability ( ) ;
141
143
assert_eq ! (
142
144
builder. dtype( ) ,
143
145
& array. dtype( ) . with_nullability( expected_nullability) ,
144
- "Take_into result should be nullable if either the indices or the array are nullable"
146
+ "Take_into result ({}) should be nullable if, and only if, either the indices ({}) or the array ({}) are nullable. ({})" ,
147
+ builder. dtype( ) ,
148
+ indices. dtype( ) . nullability( ) . verbose_display( ) ,
149
+ array. dtype( ) . nullability( ) . verbose_display( ) ,
150
+ array. encoding( ) ,
145
151
) ;
146
152
}
147
153
0 commit comments