Incorrect results with pl.struct().value_counts().struct.unnest() #20927
Labels
bug
Something isn't working
needs triage
Awaiting prioritization by a maintainer
python
Related to Python Polars
Checks
Reproducible example
Log output
Issue description
The results vary each time you run the example code, as if it were randomly shuffling the columns separately from each other.
It works correctly if you do it in separate steps or use
pl.col('x')
instead ofpl.struct('x')
(Reduced the minimal example as much as I could while still reproducing the issue - in my real case there were multiple columns like
pl.struct('x', 'y')
)Expected behavior
It should return the count associated with the correct values for each row.
It works correctly if you do it in two separate steps, it still gets shuffled but with the correct
value - count
combinations instead of independently shuffling each column.Installed versions
The text was updated successfully, but these errors were encountered: