Skip to content

Commit 777c0f9

Browse files
authored
CLN: remove unreachable _internal_get_values in blocks (#32472)
1 parent 7217393 commit 777c0f9

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

pandas/core/internals/blocks.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3144,14 +3144,15 @@ def _safe_reshape(arr, new_shape):
31443144
return arr
31453145

31463146

3147-
def _putmask_smart(v, mask, n):
3147+
def _putmask_smart(v: np.ndarray, mask: np.ndarray, n) -> np.ndarray:
31483148
"""
31493149
Return a new ndarray, try to preserve dtype if possible.
31503150
31513151
Parameters
31523152
----------
3153-
v : `values`, updated in-place (array like)
3154-
mask : np.ndarray
3153+
v : np.ndarray
3154+
`values`, updated in-place.
3155+
mask : np.ndarray[bool]
31553156
Applies to both sides (array like).
31563157
n : `new values` either scalar or an array like aligned with `values`
31573158
@@ -3218,9 +3219,6 @@ def _putmask_preserve(nv, n):
32183219
# change the dtype if needed
32193220
dtype, _ = maybe_promote(n.dtype)
32203221

3221-
if is_extension_array_dtype(v.dtype) and is_object_dtype(dtype):
3222-
v = v._internal_get_values(dtype)
3223-
else:
3224-
v = v.astype(dtype)
3222+
v = v.astype(dtype)
32253223

32263224
return _putmask_preserve(v, n)

0 commit comments

Comments
 (0)