Skip to content

Commit

Permalink
fix: Don't check nulls before conversion (#16392)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 authored May 22, 2024
1 parent 80fe7aa commit 635c97a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crates/polars-core/src/chunked_array/ndarray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ impl DataFrame {
let columns = self.get_columns();
POOL.install(|| {
columns.par_iter().enumerate().try_for_each(|(col_idx, s)| {
polars_ensure!(
s.null_count() == 0,
ComputeError: "creation of ndarray with null values is not supported"
);

let s = s.cast(&N::get_dtype())?;
let s = match s.dtype() {
DataType::Float32 => {
Expand All @@ -125,6 +120,10 @@ impl DataFrame {
},
_ => s,
};
polars_ensure!(
s.null_count() == 0,
ComputeError: "creation of ndarray with null values is not supported"
);
let ca = s.unpack::<N>()?;

let mut chunk_offset = 0;
Expand Down

0 comments on commit 635c97a

Please sign in to comment.