diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 9f201557a60..ce5c6ee720e 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -4133,8 +4133,7 @@ def unstack( # function requires. # https://github.com/pydata/xarray/pull/4746#issuecomment-753282125 any(is_duck_dask_array(v.data) for v in self.variables.values()) - # Sparse doesn't currently support advanced indexing - # https://github.com/pydata/sparse/issues/114 + # sparse.COO doesn't currently support assignment or any( isinstance(v.data, sparse_array_type) for v in self.variables.values() diff --git a/xarray/core/variable.py b/xarray/core/variable.py index bdbd1913547..48535f08958 100644 --- a/xarray/core/variable.py +++ b/xarray/core/variable.py @@ -1595,9 +1595,6 @@ def _unstack_once( if sparse: # unstacking a dense multitindexed array to a sparse array - # Use the sparse.COO constructor until sparse supports advanced indexing - # https://github.com/pydata/sparse/issues/114 - # TODO: how do we allow different sparse array types from sparse import COO codes = zip(*index.codes) @@ -1628,8 +1625,6 @@ def _unstack_once( # Indexer is a list of lists of locations. Each list is the locations # on the new dimension. This is robust to the data being sparse; in that # case the destinations will be NaN / zero. - # sparse doesn't support item assigment, - # https://github.com/pydata/sparse/issues/114 data[(..., *indexer)] = reordered return self._replace(dims=new_dims, data=data)