Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Take 2 on fixing formatting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ncpenke committed Mar 6, 2022
1 parent 6a077b9 commit 935ae65
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/array/fixed_size_list/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl<M: MutableArray> MutableFixedSizeListArray<M> {
/// Creates a new [`MutableFixedSizeListArray`] from a [`MutableArray`] and size.
pub fn new_with_field(values: M, name: &str, nullable: bool, size: usize) -> Self {
let data_type = DataType::FixedSizeList(
Box::new(Field::new(name, values.data_type().clone(), nullable)),
Box::new(Field::new(name, values.data_type().clone(), nullable)),
size,
);
assert_eq!(values.len(), 0);
Expand Down
22 changes: 13 additions & 9 deletions tests/it/array/fixed_size_list/mutable.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use arrow2::array::*;
use arrow2::datatypes::{DataType,Field};
use arrow2::datatypes::{DataType, Field};

#[test]
fn primitive() {
Expand Down Expand Up @@ -34,17 +34,21 @@ fn new_with_field() {
Some(vec![Some(4), None, Some(6)]),
];

let mut list = MutableFixedSizeListArray::new_with_field(MutablePrimitiveArray::<i32>::new(), "custom_items", false, 3);
let mut list = MutableFixedSizeListArray::new_with_field(
MutablePrimitiveArray::<i32>::new(),
"custom_items",
false,
3,
);
list.try_extend(data).unwrap();
let list: FixedSizeListArray = list.into();

assert_eq!(list.data_type(), &DataType::FixedSizeList(
Box::new(Field::new(
"custom_items",
DataType::Int32,
false
)),
3)
assert_eq!(
list.data_type(),
&DataType::FixedSizeList(
Box::new(Field::new("custom_items", DataType::Int32, false)),
3
)
);

let a = list.value(0);
Expand Down

0 comments on commit 935ae65

Please sign in to comment.