html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/7280#issuecomment-1311930838,https://api.github.com/repos/pydata/xarray/issues/7280,1311930838,IC_kwDOAMm_X85OMnnW,14808389,2022-11-11T16:39:52Z,2022-11-11T16:39:52Z,MEMBER,"changing the assignment to:
```python
s.__class__.__array_namespace__ = ...
```
should fix this, but indeed it is better to just wait on `scipy.sparse` to implement the array API (NEP47)","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1445486904
https://github.com/pydata/xarray/issues/7280#issuecomment-1311899371,https://api.github.com/repos/pydata/xarray/issues/7280,1311899371,IC_kwDOAMm_X85OMf7r,14808389,2022-11-11T16:11:12Z,2022-11-11T16:11:12Z,MEMBER,"the reason that's failing is that `scipy.sparse.coo_array` does not implement `__array_function__` or `__array_namespace__`. As soon as that's the case I'd expect it to work.
In fact, setting `s.__array_namespace__ = lambda x: x` will result in `xr.DataArray(s)` printing as
```
<4x4 sparse array of type ''
with 4 stored elements in COOrdinate format>
Dimensions without coordinates: dim_0, dim_1
```
which I think is what you were after? Though of course that does not mean that we can actually use it...","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1445486904