diff --git a/xarray/core/duck_array_ops.py b/xarray/core/duck_array_ops.py index 0c7d40113d6..26946d21cff 100644 --- a/xarray/core/duck_array_ops.py +++ b/xarray/core/duck_array_ops.py @@ -247,7 +247,7 @@ def astype(data, dtype, *, xp=None, **kwargs): xp = get_array_namespace(data) if xp == np: - # numpy currently doesn't have a astype: + # numpy<2 and dask don't have astype in their namespace return data.astype(dtype, **kwargs) return xp.astype(data, dtype, **kwargs)