API: Should isna return a copy for nullable types? #40935
Labels
API - Consistency
Internal Consistency of API/Behavior
Copy / view semantics
NA - MaskedArrays
Related to pd.NA and nullable extension arrays
Milestone
This came up in #40651, seems worth resolving. Right now
BaseMaskedArray
just directly returnsself._mask
in the implementation ofisna
. This could lead to some unintuitive user-facing behavior like:Seems like
isna
should return a copy instead to avoid this. One potential downside is losing an API-supported way to obtain 0-cost access to the mask (xref #34873).The text was updated successfully, but these errors were encountered: