Skip to content

Commit a249540

Browse files
natmokvalYi Wei
authored and
Yi Wei
committed
TYP: remove mypy ignore from pandas/core/construction.py (pandas-dev#53112)
* remove ignore[assignment] from pandas/core/construction.py * rename data * Revert "rename data" This reverts commit 533d841.
1 parent 467712e commit a249540

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pandas/core/construction.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,7 @@ def sanitize_masked_array(data: ma.MaskedArray) -> np.ndarray:
502502
if mask.any():
503503
dtype, fill_value = maybe_promote(data.dtype, np.nan)
504504
dtype = cast(np.dtype, dtype)
505-
# Incompatible types in assignment (expression has type "ndarray[Any,
506-
# dtype[Any]]", variable has type "MaskedArray[Any, Any]")
507-
data = data.astype(dtype, copy=True) # type: ignore[assignment]
505+
data = ma.asarray(data.astype(dtype, copy=True))
508506
data.soften_mask() # set hardmask False if it was True
509507
data[mask] = fill_value
510508
else:

0 commit comments

Comments
 (0)