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

Panic when building a Series of lists without an inner dtype #15523

Closed
2 tasks done
petrosbar opened this issue Apr 7, 2024 · 0 comments · Fixed by #20720
Closed
2 tasks done

Panic when building a Series of lists without an inner dtype #15523

petrosbar opened this issue Apr 7, 2024 · 0 comments · Fixed by #20720
Labels
A-panic Area: code that results in panic exceptions bug Something isn't working python Related to Python Polars

Comments

@petrosbar
Copy link
Contributor

petrosbar commented Apr 7, 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

import polars as pl

pl.Series("", [["a"], []], dtype=pl.List)
# PanicException: called `Result::unwrap()` on an `Err` value: SchemaMismatch(ErrString("invalid series dtype: expected `String`, got `null`"))

Issue description

Building a Series of lists without specifying an inner dtype, panics, when values contain an empty list. (or a list with only Nones.)

Expected behavior

pl.Series("", [["a"], []], dtype=pl.List)

# shape: (2,)
# Series: '' [list[str]]
# [
#         ["a"]
#         []
# ]
@petrosbar petrosbar added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Apr 7, 2024
@deanm0000 deanm0000 removed the needs triage Awaiting prioritization by a maintainer label Apr 11, 2024
@stinodego stinodego added the A-panic Area: code that results in panic exceptions label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-panic Area: code that results in panic exceptions bug Something isn't working python Related to Python Polars
Projects
None yet
3 participants