Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
robert3005 committed Mar 26, 2024
1 parent 9bd5ba6 commit ae77ef6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
9 changes: 2 additions & 7 deletions vortex-array/src/array/bool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,8 @@ impl FromIterator<Option<bool>> for BoolArray {
let mut validity: Vec<bool> = Vec::with_capacity(lower);
let values: Vec<bool> = iter
.map(|i| {
if let Some(v) = i {
validity.push(true);
v
} else {
validity.push(false);
false
}
validity.push(i.is_some());
i.unwrap_or_default()
})
.collect::<Vec<_>>();

Expand Down
16 changes: 6 additions & 10 deletions vortex-array/src/array/primitive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,8 @@ impl<T: NativePType> FromIterator<Option<T>> for PrimitiveArray {
let mut validity: Vec<bool> = Vec::with_capacity(lower);
let values: Vec<T> = iter
.map(|i| {
if let Some(v) = i {
validity.push(true);
v
} else {
validity.push(false);
T::default()
}
validity.push(i.is_some());
i.unwrap_or_default()
})
.collect::<Vec<_>>();

Expand Down Expand Up @@ -295,10 +290,11 @@ impl ArrayDisplay for PrimitiveArray {

#[cfg(test)]
mod test {
use crate::array::primitive::PrimitiveArray;
use crate::array::Array;
use crate::compute::scalar_at::scalar_at;
use vortex_schema::{IntWidth, Nullability, Signedness};

use super::*;
use crate::ptype::PType;
use vortex_schema::{DType, IntWidth, Nullability, Signedness};

#[test]
fn from_arrow() {
Expand Down

0 comments on commit ae77ef6

Please sign in to comment.