We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 467712e commit a249540Copy full SHA for a249540
pandas/core/construction.py
@@ -502,9 +502,7 @@ def sanitize_masked_array(data: ma.MaskedArray) -> np.ndarray:
502
if mask.any():
503
dtype, fill_value = maybe_promote(data.dtype, np.nan)
504
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]
+ data = ma.asarray(data.astype(dtype, copy=True))
508
data.soften_mask() # set hardmask False if it was True
509
data[mask] = fill_value
510
else:
0 commit comments