Skip to content

Commit 54f9f06

Browse files
committed
validity check
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
1 parent 35aa0e8 commit 54f9f06

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

vortex-array/src/arrays/patched/array.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ impl PatchedArray {
126126
///
127127
/// # Errors
128128
///
129-
/// The `inner` array must be primitive type, and it must have the same DType as the patches.
129+
/// The `inner` array must be primitive type, and it must have the same `DType` as the patches.
130+
///
131+
/// The patches cannot contain nulls themselves. Any nulls must be stored in the `inner` array's
132+
/// validity.
130133
pub fn from_array_and_patches(
131134
inner: ArrayRef,
132135
patches: &Patches,
@@ -147,6 +150,11 @@ impl PatchedArray {
147150
"PatchedArray does not support > u32::MAX patch values"
148151
);
149152

153+
vortex_ensure!(
154+
patches.values().all_valid()?,
155+
"PatchedArray cannot be built from Patches with nulls"
156+
);
157+
150158
let values_ptype = patches.dtype().as_ptype();
151159

152160
let TransposedPatches {

0 commit comments

Comments
 (0)