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

dtype=pl.Object not respected when converting pandas object Series #15177

Open
2 tasks done
Wainberg opened this issue Mar 20, 2024 · 1 comment
Open
2 tasks done

dtype=pl.Object not respected when converting pandas object Series #15177

Wainberg opened this issue Mar 20, 2024 · 1 comment
Labels
A-interop-pandas Area: interoperability with pandas bug Something isn't working P-low Priority: low python Related to Python Polars

Comments

@Wainberg
Copy link
Contributor

Wainberg commented Mar 20, 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

>>> pl.Series(pd.Series([1], dtype=object), dtype=pl.Object)
shape: (1,)
Series: '' [i64]
[
        1
]
>>> pl.Series(pd.Series([], dtype=object), dtype=pl.Object)
shape: (0,)
Series: '' [str]
[
]
>>> pl.Series(pd.Series([np.nan], dtype=object), dtype=pl.Object)
shape: (1,)
Series: '' [null]
[
        null
]
>>> pl.Series(pd.Series([None], dtype=object), dtype=pl.Object)
shape: (1,)
Series: '' [str]
[
        null
]

Log output

No response

Issue description

dtype=pl.Object is not respected when converting pandas object Series to polars.

Expected behavior

The dtype for all of these should be pl.Object.

Installed versions

Replace this line with the output of pl.show_versions(). Leave the backticks in place.
@Wainberg Wainberg added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Mar 20, 2024
@stinodego stinodego added A-interop-pandas Area: interoperability with pandas P-low Priority: low and removed needs triage Awaiting prioritization by a maintainer labels Mar 20, 2024
@stinodego
Copy link
Member

Thanks, this should indeed be fixed. This will be resolved as part of #14427

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-interop-pandas Area: interoperability with pandas bug Something isn't working P-low Priority: low python Related to Python Polars
Projects
Status: Ready
Development

No branches or pull requests

2 participants