diff --git a/dask/array/ma.py b/dask/array/ma.py index 38b971e3e8a..4edba9cf0c9 100644 --- a/dask/array/ma.py +++ b/dask/array/ma.py @@ -204,6 +204,7 @@ def getmaskarray(a): def _masked_array(data, mask=np.ma.nomask, **kwargs): + kwargs.pop("chunks", None) # A Dask kwarg, not NumPy. dtype = kwargs.pop("masked_dtype", None) return np.ma.masked_array(data, mask=mask, dtype=dtype, **kwargs) diff --git a/dask/array/tests/test_array_core.py b/dask/array/tests/test_array_core.py index e1d0fc1604d..6e80e998c23 100644 --- a/dask/array/tests/test_array_core.py +++ b/dask/array/tests/test_array_core.py @@ -1577,7 +1577,7 @@ def test_slicing_flexible_type(): def test_slicing_with_object_dtype(): # https://github.com/dask/dask/issues/6892 - d = da.from_array(np.array(["a", "b"], dtype=np.object), chunks=(1,)) + d = da.from_array(np.array(["a", "b"], dtype=object), chunks=(1,)) assert d.dtype == d[(0,)].dtype diff --git a/dask/array/tests/test_reductions.py b/dask/array/tests/test_reductions.py index f792396160a..a773a20319c 100644 --- a/dask/array/tests/test_reductions.py +++ b/dask/array/tests/test_reductions.py @@ -542,7 +542,7 @@ def test_array_cumreduction_axis(func, use_nan, axis, method): da_func = getattr(da, func) s = (10, 11, 12) - a = np.arange(np.prod(s)).reshape(s) + a = np.arange(np.prod(s), dtype=float).reshape(s) if use_nan: a[1] = np.nan d = da.from_array(a, chunks=(4, 5, 6))