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/6374#issuecomment-1081553127,https://api.github.com/repos/pydata/xarray/issues/6374,1081553127,IC_kwDOAMm_X85AdzDn,22245117,2022-03-29T08:01:36Z,2022-03-29T08:01:36Z,CONTRIBUTOR,"Thanks! #6420 looks at `.zarray[""_NCZARR_ARRAY""][""dimrefs""]` only if `.zattrs[""_ARRAY_ATTRIBUTE""]` is missing.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1172229856
https://github.com/pydata/xarray/issues/6374#issuecomment-1081139207,https://api.github.com/repos/pydata/xarray/issues/6374,1081139207,IC_kwDOAMm_X85AcOAH,22245117,2022-03-28T21:01:19Z,2022-03-28T21:01:19Z,CONTRIBUTOR,"Adding support for reading `NCZarr` in the `""zarr""` backend should be quite easy if `xarray` doesn't need to integrate the additional features in `NCZarr` (e.g., groups, fully qualified names, dtypes for attributes). It looks like the main difference is that the dimension names stored by `xarray` in `.zattrs[""_ARRAY_DIMENSIONS""]` are stored by `NCZarr` in `.zarray[""_NCZARR_ARRAY""][""dimrefs""]`. I drafted PR #6420 to explore what it would take to support reading NCZarr in xarray's `""zarr""` backend, and I don't think there are major changes/additions needed.
(I'm experiencing issues with Windows in PR #6420. I think they need to be explored in netcdf4-python or netcdf-c though - I've added a comment in the PR)
I'm not sure whether it is better to (i) add direct support for `NCZarr` in `xarray` or (ii) just rely on the `netcdf4` backend. After playing a bit with both backends, I have a few comments if option (ii) is chosen:
* I would change the error raised when `""_ARRAY_DIMENSIONS""` is not present, suggesting to try the `netcdf4` backend as well. Also, I think it's worth pointing out in the documentation or in the error message where to find information on how to open/write zarr data with the `netcdf4` backend. I suspect right now it's not easy to find that information for python/xarray users.
* I would consider starting a deprecation cycle for `open_zarr`, so it will be more clear that `zarr` data can be opened using various backends.
* If `""_ARRAY_DIMENSIONS""` and `""_NC*""` attributes will coexist in the next version of `NCZarr`, the `zarr` backend will be able to open `NCZarr` but will treat `""_NC*""` attributes as regular attributes. I think the `""zarr""` backend would have to handle `""_NC*""` attributes (e.g., drop or hide), otherwise there can be issues when writing:
```
TypeError: Invalid value for attr '_NCZARR_ATTR': {'types': {'Conventions': '