polars icon indicating copy to clipboard operation
polars copied to clipboard

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

Open Wainberg opened this issue 1 year ago • 1 comments

Checks

  • [X] I have checked that this issue has not already been reported.
  • [X] 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 avatar Mar 20 '24 06:03 Wainberg

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

stinodego avatar Mar 22 '24 17:03 stinodego