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

Open
2 tasks done
petrosbar opened this issue Apr 7, 2024 · 0 comments · May be fixed by #15525
Open
2 tasks done

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

petrosbar opened this issue Apr 7, 2024 · 0 comments · May be fixed by #15525
Labels
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python Related to Python Polars
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants