id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type 2024303763,I_kwDOAMm_X854qGyT,8516,Appending to a ZARR dataset removes dimension separator attribute,31890,open,0,,,1,2023-12-04T16:52:27Z,2023-12-04T17:42:37Z,,NONE,,,,"### What happened? When creating a ZARR store with `dimension_separator=""/""`, the `to_zarr_store` method removes `dimension_separator` attribute in the `.zarray` file. ### What did you expect to happen? It should retain the original storage attributes. ### Minimal Complete Verifiable Example ```Python import json import xarray as xr from zarr.storage import MemoryStore store = MemoryStore(dimension_separator=""/"") ds = xr.Dataset( {""data"": xr.DataArray([0.0], dims=(""x"",))}, coords={ ""x"": xr.DataArray([0.0], dims=(""x"",)), }, ) ds.to_zarr(store, mode=""w"", consolidated=False) assert json.loads(store[""data/.zarray""].decode()).get(""dimension_separator"") == ""/"" ds = xr.Dataset( {""data"": xr.DataArray([1.0], dims=(""x"",))}, coords={ ""x"": xr.DataArray([1.0], dims=(""x"",)), }, ) ds.to_zarr( store, append_dim=""x"", consolidated=False ) assert json.loads(store[""data/.zarray""].decode()).get(""dimension_separator"") == ""/"" ``` ### MVCE confirmation - [X] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray. - [X] Complete example — the example is self-contained, including all data and the text of any traceback. - [X] Verifiable example — the example copy & pastes into an IPython prompt or [Binder notebook](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/blank_template.ipynb), returning the result. - [X] New issue — a search of GitHub Issues suggests this is not a duplicate. - [X] Recent environment — the issue occurs with the latest version of xarray and its dependencies. ### Relevant log output ```Python AssertionError Traceback (most recent call last) File ~/xarray_repro/run.py:29 18 ds = xr.Dataset( 19 {""data"": xr.DataArray([1.0], dims=(""x"",))}, 20 coords={ 21 ""x"": xr.DataArray([1.0], dims=(""x"",)), 22 }, 23 ) 24 ds.to_zarr( 25 store, 26 append_dim=""x"", 27 consolidated=False 28 ) ---> 29 assert json.loads(store[""data/.zarray""].decode()).get(""dimension_separator"") == ""/"" AssertionError: ``` ### Anything else we need to know? _No response_ ### Environment
INSTALLED VERSIONS ------------------ commit: None python: 3.11.5 (main, Aug 24 2023, 15:18:16) [Clang 14.0.3 (clang-1403.0.22.14.1)] python-bits: 64 OS: Darwin OS-release: 22.5.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: None libnetcdf: None xarray: 2023.11.0 pandas: 2.1.3 numpy: 1.26.2 scipy: None netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: 2.16.1 cftime: None nc_time_axis: None iris: None bottleneck: None dask: 2023.11.0 distributed: None matplotlib: None cartopy: None seaborn: None numbagg: None fsspec: 2023.12.0 cupy: None pint: None sparse: None flox: None numpy_groupies: None setuptools: 68.1.2 pip: 23.2.1 conda: None pytest: None mypy: None IPython: 8.18.1 sphinx: None
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8516/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue