You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using explode inside of a group_by, I was expecting to get the same result as exploding then grouping. Instead, it feels like only the first element of b was exploded (2) and the other values (3, 4) were dropped.
I noticed that my output shrunk while refactoring and traced it back to this. No reason for using one over the other. Sorry in advance if I'm thinking about this wrong.
Expected behavior
Both forms produce the bottom dataframe (referring to log output).
Checks
Reproducible example
Log output
% POLARS_VERBOSE=1 python3 report.py shape: (1, 3) ┌─────┬───────────┬─────┐ │ a ┆ b ┆ c │ │ --- ┆ --- ┆ --- │ │ i64 ┆ list[i64] ┆ i64 │ ╞═════╪═══════════╪═════╡ │ 1 ┆ [2, 3, 4] ┆ 5 │ └─────┴───────────┴─────┘ keys/aggregates are not partitionable: running default HASH AGGREGATION shape: (1, 3) ┌─────┬─────┬─────┐ │ a ┆ b ┆ c │ │ --- ┆ --- ┆ --- │ │ i64 ┆ i64 ┆ i64 │ ╞═════╪═════╪═════╡ │ 1 ┆ 2 ┆ 5 │ └─────┴─────┴─────┘ DATAFRAME < 1000 rows: running default HASH AGGREGATION shape: (3, 3) ┌─────┬─────┬─────┐ │ a ┆ b ┆ c │ │ --- ┆ --- ┆ --- │ │ i64 ┆ i64 ┆ i64 │ ╞═════╪═════╪═════╡ │ 1 ┆ 3 ┆ 5 │ │ 1 ┆ 4 ┆ 5 │ │ 1 ┆ 2 ┆ 5 │ └─────┴─────┴─────┘
Issue description
When using
explode
inside of agroup_by
, I was expecting to get the same result as exploding then grouping. Instead, it feels like only the first element ofb
was exploded (2
) and the other values (3, 4
) were dropped.I noticed that my output shrunk while refactoring and traced it back to this. No reason for using one over the other. Sorry in advance if I'm thinking about this wrong.
Expected behavior
Both forms produce the bottom dataframe (referring to log output).
Installed versions
The text was updated successfully, but these errors were encountered: