File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
vortex-vector/src/decimal Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -96,13 +96,15 @@ impl<D: NativeDecimalType> DVector<D> {
9696 ) ;
9797 }
9898
99- // We assert that each element is within bounds for the given precision/scale.
100- if let Some ( invalid) = elements. iter ( ) . find ( |e| !ps. is_valid ( * * e) ) {
101- vortex_bail ! (
102- "One or more elements (e.g. {invalid}) are out of bounds for precision {} and scale {}" ,
103- ps. precision( ) ,
104- ps. scale( ) ,
105- ) ;
99+ // We assert that each non-null element is within bounds for the given precision/scale.
100+ for ( idx, element) in elements. iter ( ) . enumerate ( ) {
101+ if validity. value ( idx) && !ps. is_valid ( * element) {
102+ vortex_bail ! (
103+ "One or more elements (e.g. {element}) are out of bounds for precision {} and scale {}" ,
104+ ps. precision( ) ,
105+ ps. scale( ) ,
106+ ) ;
107+ }
106108 }
107109
108110 Ok ( Self {
You can’t perform that action at this time.
0 commit comments