Skip to content

Commit

Permalink
fix(rust): Allow full-null Object series to be built (#17870)
Browse files Browse the repository at this point in the history
  • Loading branch information
orlp authored Jul 25, 2024
1 parent 54b7fb8 commit 069ae8c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/polars-core/src/series/ops/null.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#[cfg(feature = "object")]
use crate::chunked_array::object::registry::get_object_builder;
use crate::prelude::*;

impl Series {
Expand Down Expand Up @@ -60,6 +62,14 @@ impl Series {
let dtype = kind.materialize().expect("expected known type");
Series::full_null(name, size, &dtype)
},
#[cfg(feature = "object")]
DataType::Object(_, _) => {
let mut builder = get_object_builder(name, size);
for _ in 0..size {
builder.append_null();
}
builder.to_series()
},
_ => {
macro_rules! primitive {
($type:ty) => {{
Expand Down

0 comments on commit 069ae8c

Please sign in to comment.