File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ impl TryFrom<&ArrayRef> for RecordBatch {
2929 } ;
3030
3131 vortex_ensure ! (
32- matches! ( struct_array. validity( ) ?, Validity :: AllValid ) ,
32+ struct_array. validity( ) ?. no_nulls ( ) ,
3333 "RecordBatch can only be constructed from StructArray with no nulls"
3434 ) ;
3535
Original file line number Diff line number Diff line change @@ -112,6 +112,13 @@ impl Validity {
112112 }
113113 }
114114
115+ /// Returns `true` if this validity guarantees no null values, i.e. it is either
116+ /// [`Validity::NonNullable`] or [`Validity::AllValid`].
117+ #[ inline]
118+ pub fn no_nulls ( & self ) -> bool {
119+ matches ! ( self , Self :: NonNullable | Self :: AllValid )
120+ }
121+
115122 /// The union nullability and validity.
116123 #[ inline]
117124 pub fn union_nullability ( self , nullability : Nullability ) -> Self {
You can’t perform that action at this time.
0 commit comments