REGR: Fix regression RecursionError when replacing numeric scalar with None
- [x] closes #48231 (Replace xxxx with the Github issue number)
- [x] Tests added and passed if fixing a bug or adding a new feature
- [x] All code checks passed.
- [x] Added type annotations to new arguments/methods/functions.
- [x] Added an entry in the latest
doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.
If value is None, self.coerce_to_target_dtype returns float64 if self is Numeric. But: self._can_hold_element(value) is False, since NumPy can not set None into a numeric array.
This should probably be consistent...
blocking for the short term
we have #48034 on the 1.4.x milestone. knowing that the backport of replace changes was not trivial last time due to changes on main, lets not make any other changes till that issue has been investigated.
looking at #48034, it appears that that issue is moreless orthogonal to this issue, so perhaps no reason to block.
LGTM (IMO I think the 1.4.x behavior is more reasonable than the RecurssionError behavior). cc @simonjayhawkins not sure if you still have any objections with moving forward with this behavior in 1.5.x
Could you merge main once more? I tried restarting the (seemingly) unrelated test failures but they are still failing.
Yeah restarted as well earlier. Merged main now
Thanks @phofl. Maybe please create an issue regarding using replace to replace NA-like values with NA-like values if we don't have one
Opened #49421