Open thesword53 opened 3 months ago
Hey @thesword53,
I realized that issue also affected something I am working on so I went down the rabbit hole and it seems like what is happening is that the Series
gets cast to a np.ndarray
then the is isna
operation gets applied and when they rebuild the Series
object, we lose the original type (pyarrow) and it seems like it just rebuilds without any assumption of type (as we pass an np.ndarray
of bool it just set the type of the Series to bool
and not bool[pyarrow]
).
This also affects if you create a Dataframe
where the type of the column was originally uint8[pyarrow]
and it gets cast into bool
and not bool[pyarrow]
.
I'd like to work on this
take
take
take
Can't seem to assign the issue to myself, but I'll be opening a PR for this in a bit. Thanks @loicdiridollou for further investigating
Take
This is another good issue to track for PDEP-13 https://github.com/pandas-dev/pandas/pull/58455
Pandas version 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 pandas.
[ ] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
s.isna().dtype
isBoolDType
(bool
) instead ofArrowDtype(pa.bool_())
(bool[pyarrow]
)Expected Behavior
Installed Versions