Skip to content
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

Concatenating to a list column using another column throws PanicException with empty DataFrame #16924

Closed
2 tasks done
bkos opened this issue Jun 13, 2024 · 1 comment · Fixed by #17742
Closed
2 tasks done
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@bkos
Copy link

bkos commented Jun 13, 2024

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

df = pl.DataFrame(schema={'a': pl.Int16, 'b': pl.List(pl.String)})

# Works
df.with_columns(pl.col('b').list.concat([1]))

# Breaks
df.with_columns(pl.col('b').list.concat([pl.col('a').cast(pl.String)]))

Log output

PanicException: called `Result::unwrap()` on an `Err` value: ComputeError(ErrString("cannot reshape len 0 into shape [-1, 1]"))

Issue description

Concatenating to a list column using another column throws PanicException with empty DataFrame

Expected behavior

To return empty DataFrame

Installed versions

--------Version info---------
Polars:               0.20.31
Index type:           UInt32
Platform:             Windows-10
Python:               3.11.7
@bkos bkos added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Jun 13, 2024
@Object905
Copy link
Contributor

Can reproduce. It was working on earlier versions, but after upgrading to 1.2 it's still there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars
Projects
None yet
2 participants