Skip to content

Commit

Permalink
almost there
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Oct 20, 2023
1 parent fa1e341 commit 28490ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion crates/polars-core/src/chunked_array/builder/boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ impl ChunkedBuilder<bool, BooleanType> for BooleanChunkedBuilder {

fn finish(mut self) -> BooleanChunked {
let arr = self.array_builder.as_box();
let length = arr.len() as IdxSize;

let mut ca = ChunkedArray {
field: Arc::new(self.field),
chunks: vec![arr],
phantom: PhantomData,
bit_settings: Default::default(),
length: 0,
length,
null_count: 0,
};
ca.compute_len();
Expand Down
7 changes: 4 additions & 3 deletions crates/polars-lazy/src/physical_plan/planner/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,10 +603,11 @@ where

let mut iter = chunks.into_iter();
let first = iter.next().unwrap();
let out = iter.fold(first, |mut acc, s| {
acc.append(&s).unwrap();
let dtype = first.dtype();
let out = iter.fold(first.to_physical_repr().into_owned(), |mut acc, s| {
acc.append(&s.to_physical_repr()).unwrap();
acc
});

f(out).map(Some)
unsafe { f(out.cast_unchecked(&dtype).unwrap()).map(Some) }
}

0 comments on commit 28490ee

Please sign in to comment.