Skip to content

Commit

Permalink
remove rechunked_validity
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion committed Dec 4, 2023
1 parent 5a42fd8 commit 35a5af0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
17 changes: 0 additions & 17 deletions crates/polars-core/src/chunked_array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ use arrow::legacy::kernels::concatenate::concatenate_owned_unchecked;
use arrow::legacy::prelude::*;
use bitflags::bitflags;

use self::upstream_traits::finish_validities;
use crate::series::IsSorted;
use crate::utils::{first_non_null, last_non_null, CustomIterTools};

Expand Down Expand Up @@ -236,22 +235,6 @@ impl<T: PolarsDataType> ChunkedArray<T> {
self.chunks.iter().map(to_validity)
}

/// Construct a Bitmap representing the validity of all chunks without
/// rechunking the values.
pub fn rechunked_validity(&self) -> Option<Bitmap> {
if self.has_validity() {
let validities = self
.iter_validities()
.map(|x| x.cloned())
.zip(self.chunk_id())
.collect::<Vec<(Option<Bitmap>, usize)>>();

finish_validities(validities, self.len())
} else {
None
}
}

#[inline]
/// Return if any the chunks in this [`ChunkedArray`] have a validity bitmap.
/// no bitmap means no null values.
Expand Down
2 changes: 1 addition & 1 deletion crates/polars-core/src/chunked_array/ops/arity.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::error::Error;

use arrow::array::Array;
use arrow::legacy::utils::combine_validities_and;
use arrow::compute::utils::combine_validities_and;

use crate::datatypes::{ArrayCollectIterExt, ArrayFromIter, StaticArray};
use crate::prelude::{ChunkedArray, PolarsDataType};
Expand Down
5 changes: 1 addition & 4 deletions crates/polars-core/src/chunked_array/upstream_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,7 @@ where
}
}

pub fn finish_validities(
validities: Vec<(Option<Bitmap>, usize)>,
capacity: usize,
) -> Option<Bitmap> {
fn finish_validities(validities: Vec<(Option<Bitmap>, usize)>, capacity: usize) -> Option<Bitmap> {
if validities.iter().any(|(v, _)| v.is_some()) {
let mut bitmap = MutableBitmap::with_capacity(capacity);
for (valids, len) in validities {
Expand Down

0 comments on commit 35a5af0

Please sign in to comment.