From a22616fe939b085e2ae5f01f95918e574deb80dc Mon Sep 17 00:00:00 2001 From: Joe Isaacs Date: Thu, 19 Dec 2024 12:23:35 +0000 Subject: [PATCH] update --- vortex-array/src/array/arbitrary.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/vortex-array/src/array/arbitrary.rs b/vortex-array/src/array/arbitrary.rs index 34cc24960..23b38d33c 100644 --- a/vortex-array/src/array/arbitrary.rs +++ b/vortex-array/src/array/arbitrary.rs @@ -9,7 +9,6 @@ use vortex_dtype::{DType, NativePType, Nullability, PType}; use vortex_error::{VortexExpect, VortexUnwrap}; use vortex_scalar::arbitrary::random_scalar; use vortex_scalar::Scalar; -use Nullability::Nullable; use super::{BoolArray, ChunkedArray, NullArray, PrimitiveArray, StructArray}; use crate::array::{VarBinArray, VarBinViewArray}; @@ -131,7 +130,7 @@ where let list_len = u.int_in_range(0..=20)?; let mut builder = ListBuilder::::with_capacity(ldt.clone(), *n, 1); for _ in 0..list_len { - if matches!(n, Nullable) || u.arbitrary::()? { + if matches!(n, Nullability::Nullable) || u.arbitrary::()? { let elem_len = u.int_in_range(0..=20)?; let elem = (0..elem_len) .map(|_| random_scalar(u, ldt)) @@ -169,10 +168,10 @@ fn random_string( _ => unreachable!(), }) } - Nullable => { + Nullability::Nullable => { let v = arbitrary_vec_of_len::>(u, len)?; Ok(match u.int_in_range(0..=1)? { - 0 => VarBinArray::from_iter(v, DType::Utf8(Nullable)).into_array(), + 0 => VarBinArray::from_iter(v, DType::Utf8(Nullability::Nullable)).into_array(), 1 => VarBinViewArray::from_iter_nullable_str(v).into_array(), _ => unreachable!(), }) @@ -194,10 +193,10 @@ fn random_bytes( _ => unreachable!(), }) } - Nullable => { + Nullability::Nullable => { let v = arbitrary_vec_of_len::>>(u, len)?; Ok(match u.int_in_range(0..=1)? { - 0 => VarBinArray::from_iter(v, DType::Binary(Nullable)).into_array(), + 0 => VarBinArray::from_iter(v, DType::Binary(Nullability::Nullable)).into_array(), 1 => VarBinViewArray::from_iter_nullable_bin(v).into_array(), _ => unreachable!(), }) @@ -230,7 +229,7 @@ fn random_bool( fn random_validity(u: &mut Unstructured, nullability: Nullability, len: usize) -> Result { match nullability { Nullability::NonNullable => Ok(Validity::NonNullable), - Nullable => Ok(match u.int_in_range(0..=2)? { + Nullability::Nullable => Ok(match u.int_in_range(0..=2)? { 0 => Validity::AllValid, 1 => Validity::AllInvalid, 2 => Validity::from_iter(arbitrary_vec_of_len::(u, Some(len))?),