polars
polars copied to clipboard
Creating a series of empty structs produces a series of a single item
Polars version checks
-
[X] I have checked that this issue has not already been reported.
-
[X] I have confirmed this bug exists on the latest version of Polars.
Issue description
creating a series of empty structs returns an invalid result, and regardless of the number of empty items, it will always produce a series with exactly 1 item.
related to #6148
Reproducible example
use polars::prelude::*;
fn main() {
let dtype = DataType::Struct(vec![]);
let structs = vec![AnyValue::StructOwned(Box::new((vec![], vec![]))); 3];
let s = Series::from_any_values_and_dtype("", &structs, &dtype).unwrap();
assert_eq!(s.len(), 3);
}
Expected behavior
I'd expect the series to have the same length of the input vec.
Installed versions
polars = {git = "https://github.com/pola-rs/polars.git", branch = "master", features = ["dtype-full"]}