polars
polars copied to clipboard
Make `unnest()` "unnest" all columns by default
Description
Most of the times in my experience you want to "unnest" ALL of the structs you have or only have 1-2 that you want to unnest.
It is annoying to have to specify those explicitly in the unnest
call. Sometimes you change your data or column names but still want to unnest and need to remember to change names everywhere.
Imo unnest()
means "unnest" (all) my data so when providing no argument it should default to unnesting everything
pl.DataFrame(
{
"s1": [
{"a": 1, "b": 2},
{"a": 3, "b": 4},
],
"s2": [
{"c": 5, "d": 6},
{"c": 7, "d": 8},
],
}
).unnest("s1", "s2")
- currently I have to use
.unnest("s1", "s2")
- desired
unnest()
: meaning "unnest all column"