Skip to content

Commit

Permalink
arb offset
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-isaacs committed Dec 18, 2024
1 parent f5a01f1 commit 3fe0f94
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions vortex-array/src/array/arbitrary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::sync::Arc;
use arbitrary::{Arbitrary, Result, Unstructured};
use arrow_buffer::BooleanBuffer;
use builders::ListBuilder;
use num_traits::PrimInt;
use num_traits::{AsPrimitive, PrimInt};
use vortex_dtype::{DType, NativePType, Nullability, PType};
use vortex_error::{VortexExpect, VortexUnwrap};
use vortex_scalar::arbitrary::random_scalar;
Expand Down Expand Up @@ -118,11 +118,16 @@ fn random_list(u: &mut Unstructured, ldt: &Arc<DType>, n: &Nullability) -> Resul
}
}

fn random_list_offset<O: PrimInt + NativePType>(
fn random_list_offset<O>(
u: &mut Unstructured,
ldt: &Arc<DType>,
n: &Nullability,
) -> Result<ArrayData> {
) -> Result<ArrayData>
where
O: PrimInt + NativePType + 'static,
Scalar: From<O>,
usize: AsPrimitive<O>,
{
let list_len = u.int_in_range(0..=20)?;
let mut builder = ListBuilder::<O>::with_capacity(ldt.clone(), *n, 1);
for _ in 0..list_len {
Expand Down

0 comments on commit 3fe0f94

Please sign in to comment.