Open robinvd opened 9 months ago
Now (on v1.4.1), this code actually raises an exception. Would love to see this as a test case in the repo!
Can indeed be closed i think. But how would you shift the whole struct now :thinking:
Good question.
This panics:
df.with_columns(prev=pl.col("data").shift(1, fill_value=pl.struct(x=0, y=0)))
# thread '<unnamed>' panicked at crates/polars-core/src/utils/mod.rs:915:5:
# PanicException: expected arrays of the same length
Checks
Reproducible example
output
Log output
Issue description
When doing a shift on a struct the default value is not applied to all fields
Expected behavior
Both fields in the struct should be set to the default value
0
Installed versions