New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shift_and_fill
on list column with over
raises PanicException
#4310
Comments
Unfortunately, the fix in 0.14.0 has introduced another bug. Using some of the examples above, when a column of type list is shifted using (
df
.with_column(
pl.col('col_list').shift(1)
.over('col_int')
.alias('list_shifted')
)
)
(
df
.with_column(
pl.col('col_list').shift_and_fill(1, [])
.over('col_int')
.alias('list_shifted')
)
)
EditI should have noted that (
df
.with_column(
pl.col('col_list').shift(1)
.alias('list_shifted')
)
)
(
df
.with_column(
pl.col('col_list').shift_and_fill(1, [])
.alias('list_shifted')
)
)
I discovered this as I was about to update the Stack Overflow question. |
For documentation: Stack Overflow updated to indicate that this is resolved. |
What language are you using?
Python
Have you tried latest version of polars?
yes
What version of polars are you using?
0.13.62
What operating system are you using polars on?
Linux Mint 20.3
What language version are you using
python 3.10.4
Describe your bug.
Using
shift_and_fill
on a column of type list along withover
causes a PanicException.I've also included a MWE of combining
shift
andover
on a list column that can cause a seg fault. (I'm guessing that this is related.)What are the steps to reproduce the behavior?
Let's start with this data:
Running this query raises a PanicException.
If we use a
shift_and_fill
without usingover
, we get no error.Different Fill Values
Trying different fill values in the
shift_and_fill
still leads to errors.shift
can cause a seg faultThis query using
shift
instead ofshift_and_fill
does not lead to an error.However, a query like the following - which includes a
sort
and a comparison between lists columns - can sometimes cause a seg fault. (Sometimes, it just leads to an error.)Other Notes
The above is based on a Stack Overflow question.
The text was updated successfully, but these errors were encountered: