diff --git a/xarray/tests/test_sparse.py b/xarray/tests/test_sparse.py index a69e370572b..aebca9b24bc 100644 --- a/xarray/tests/test_sparse.py +++ b/xarray/tests/test_sparse.py @@ -7,6 +7,7 @@ import numpy as np import pandas as pd import pytest +from packaging.version import Version import xarray as xr import xarray.ufuncs as xu @@ -719,13 +720,17 @@ def test_sparse_dask_dataset_repr(self): ds = xr.Dataset( data_vars={"a": ("x", sparse.COO.from_numpy(np.ones(4)))} ).chunk() + if Version(sparse.__version__) >= Version("0.16.0"): + meta = "sparse.numba_backend._coo.core.COO" + else: + meta = "sparse.COO" expected = dedent( - """\ + f"""\ Size: 32B Dimensions: (x: 4) Dimensions without coordinates: x Data variables: - a (x) float64 32B dask.array""" + a (x) float64 32B dask.array""" ) assert expected == repr(ds)