Calling explode()
on multiple columns of a dataframe slice throws an error.
#17648
Closed
2 tasks done
Labels
accepted
Ready for implementation
bug
Something isn't working
needs triage
Awaiting prioritization by a maintainer
python
Related to Python Polars
Checks
Reproducible example
Log output
Issue description
This issue occurs only when using a slice of a dataframe to perform the computation. For example, the following example runs correctly.
The 'counts' of each list are correct:
Output (sorry for the rough formatting):
shape: (4, 2)
│ a_len ┆ count_len │
│ u32 ┆ u32 │
╞═══════╪
│ 2 ┆ 2 │
│ 3 ┆ 3 │
│ 3 ┆ 3 │
│ 1 ┆ 1 │
└───────┴
Something like this should also work, but does not, throwing the exact same error. Note that the collect() executes with no issues.
Expected behavior
The example should run, and produce
┌──────┐
│ a ┆ count │
│ i64 ┆ i64 │
╞═════╡
│ 2 ┆ 0 │
│ 6 ┆ 1 │
│ 7 ┆ 2 │
│ 3 ┆ 0 │
│ 9 ┆ 1 │
│ 2 ┆ 2 │
└─────┴
Installed versions
The text was updated successfully, but these errors were encountered: