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

fix: Do not raise when constructing from a list of Series with Nones #14942

Merged
merged 1 commit into from
Mar 9, 2024

Conversation

petrosbar
Copy link
Contributor

@petrosbar petrosbar commented Mar 9, 2024

Currently, constructing a Series from a list of Series which also contains Nones raises:

import polars as pl

inner = pl.Series("inner", [1, 2, 3])
pl.Series("a", [inner, None])
# AttributeError: 'NoneType' object has no attribute '_s'

This PR fixes this:

import polars as pl

inner = pl.Series("inner", [1, 2, 3])
pl.Series("a", [inner, None])

Output:

Series: 'a' [list[i64]]
[
        [1, 2, 3]
        null
]

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Mar 9, 2024
@ritchie46
Copy link
Member

Good fix. Thanks a lot.

@ritchie46 ritchie46 merged commit 9ef05cc into pola-rs:main Mar 9, 2024
19 checks passed
@petrosbar petrosbar deleted the list-series-nones branch March 9, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants