PDEP-6: special case (allow) upcasting to float when setting NaN in integer series #54660
Labels
API Design
Blocker
Blocking issue or pull request for an upcoming release
Indexing
Related to indexing on series/frames, not to indexes themselves
Milestone
Currently, on the main branch with the PDEP-6 (no-casting in setitem) warnings, we get:
Given that this is a bit a special cast (with numpy integers not supporting missing values, so we make this upcast in other places like reindexing as well), and in a possible future with nullable integers by default, the above would again be allowed (and then preserve the dtype), we could decide to special case specifically setting NaN into an integer Series for now, and still allow the upcast in this specific case.
@MarcoGorelli opening this issue to keep track of what we discussed. You already started on a fix (#54527?), and I also started working on a short-circuiting helper function to determine if we have an array of only-NaNs-or-integers.
The text was updated successfully, but these errors were encountered: