Skip to content

Commit

Permalink
fix(rust): Ensure ListPrimitiveBuilder dtype invariant is asserted (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 authored Sep 24, 2024
1 parent afff7a4 commit e9d835d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ where
name: PlSmallStr,
capacity: usize,
values_capacity: usize,
logical_type: DataType,
inner_type: DataType,
) -> Self {
assert!(
inner_type.is_numeric() || inner_type.is_temporal(),
"inner type must be primitive"
);
let values = MutablePrimitiveArray::<T::Native>::with_capacity(values_capacity);
let builder = LargePrimitiveBuilder::<T::Native>::new_with_capacity(values, capacity);
let field = Field::new(name, DataType::List(Box::new(logical_type)));
let field = Field::new(name, DataType::List(Box::new(inner_type)));

Self {
builder,
Expand Down

0 comments on commit e9d835d

Please sign in to comment.