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 1983818298,PR_kwDOAMm_X85e8FK8,8425,Properly closes zarr groups in zarr store,20397548,closed,0,,,9,2023-11-08T15:05:55Z,2023-12-01T02:27:16Z,2023-12-01T02:20:14Z,CONTRIBUTOR,,0,pydata/xarray/pulls/8425,"If the zarr backend is using a store which needs closing, e.g., a zip store, it should be closed with the xarray zarrstore backend. This is occurred when i tried to save a dataset to a zarr file while giving the .zip file extension. I have not done extensive tests on this small piece of code, so it might not cover all use cases. Let me know if I need to add tests or more documentation! - [x] Tests added - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8425/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 2007887740,I_kwDOAMm_X853re98,8480,Using `where` without `keep_attrs=True` removes attrs stored in coordinates on the inputs,20397548,closed,0,,,3,2023-11-23T10:16:04Z,2023-11-24T08:24:35Z,2023-11-24T08:24:35Z,CONTRIBUTOR,,,,"### What happened? Sometimes I store info about coordinates in the attributes on the coordinate. It's useful for stuff like units or resolutions. I noticed that these attributes can go missing from DataArrays that are used as the input to `xr.where`, which is a somewhat unexpected side-effect. ### What did you expect to happen? The input DataArray is left unmodified by `xr.where`. ### Minimal Complete Verifiable Example ```Python import xarray as xr import numpy as np values = xr.DataArray(np.linspace(0, 2), dims='x') values = values.assign_coords(x=values.x.assign_attrs(attr=10)) print('attr' in values.x.attrs) # True nonzero = values != 0 print('attr' in values.x.attrs) # True xr.where(nonzero, values, np.nan, keep_attrs=False) print('attr' in values.x.attrs) # False ``` ### 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 _No response_ ### Anything else we need to know? _No response_ ### Environment
INSTALLED VERSIONS ------------------ commit: None python: 3.11.0 | packaged by conda-forge | (main, Oct 25 2022, 06:09:06) [MSC v.1929 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 142 Stepping 12, GenuineIntel byteorder: little LC_ALL: None LANG: None LOCALE: ('Swedish_Sweden', '1252') libhdf5: None libnetcdf: None xarray: 2023.11.0 pandas: 1.5.1 numpy: 1.23.4 scipy: 1.9.3 netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: None nc_time_axis: None iris: None bottleneck: None dask: None distributed: None matplotlib: None cartopy: None seaborn: None numbagg: None fsspec: None cupy: None pint: None sparse: None flox: None numpy_groupies: None setuptools: 65.5.1 pip: 22.3.1 conda: None pytest: None mypy: None IPython: 8.6.0 sphinx: None
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8480/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue