We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 103d3b2 commit e55b3eeCopy full SHA for e55b3ee
pandas/core/construction.py
@@ -496,9 +496,7 @@ def sanitize_masked_array(data: ma.MaskedArray) -> np.ndarray:
496
if mask.any():
497
dtype, fill_value = maybe_promote(data.dtype, np.nan)
498
dtype = cast(np.dtype, dtype)
499
- # Incompatible types in assignment (expression has type "ndarray[Any,
500
- # dtype[Any]]", variable has type "MaskedArray[Any, Any]")
501
- data = data.astype(dtype, copy=True) # type: ignore[assignment]
+ data = ma.asarray(data.astype(dtype, copy=True))
502
data.soften_mask() # set hardmask False if it was True
503
data[mask] = fill_value
504
else:
0 commit comments