Closed thomasaarholt closed 4 days ago
This does run again on main:
>>> pl.DataFrame().with_columns([s_foo, s_bar])
shape: (2, 2)
┌─────┬───────────────────────┐
│ foo ┆ bar │
│ --- ┆ --- │
│ i64 ┆ struct[1] │
╞═════╪═══════════════════════╡
│ 1 ┆ {2024-01-01 00:00:00} │
│ 2 ┆ {2024-01-01 00:00:00} │
└─────┴───────────────────────┘
It seems it was fixed by https://github.com/pola-rs/polars/pull/19148
Ah! That’s the best case! Thanks!
Checks
Reproducible example
Issue description
We discovered this one at patito, which is a dataframe validation library for polars. We have a
.examples()
method, which constructs single or multiple row example series of a given schema, which then a concatenated usingwith_columns
.Broadcasting a series of length 1 works fine using ints, datetimes etc. But not with structs containing datetimes as per the repro above.
Using other types works fine:
Using a struct of ints and floats works fine:
Broadcasting with structs using
with_columns
used to work in polars 1.6. For the MWE example above, in 1.7.1, the following error is returned:Expected behavior
I'd expect the old behaviour as per the commented out section in the MWE.
Installed versions