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/4798#issuecomment-759484919,https://api.github.com/repos/pydata/xarray/issues/4798,759484919,MDEyOklzc3VlQ29tbWVudDc1OTQ4NDkxOQ==,2448579,2021-01-13T14:29:30Z,2021-01-13T14:29:30Z,MEMBER,Could add a note to the docstring... ,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,784484810
https://github.com/pydata/xarray/issues/4798#issuecomment-759463781,https://api.github.com/repos/pydata/xarray/issues/4798,759463781,MDEyOklzc3VlQ29tbWVudDc1OTQ2Mzc4MQ==,5821660,2021-01-13T13:55:37Z,2021-01-13T13:55:37Z,MEMBER,@mikapfl This was added with https://github.com/Unidata/netcdf4-python/pull/597. But I can't say anything profound why the single element is extracted from the list.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,784484810
https://github.com/pydata/xarray/issues/4798#issuecomment-759456390,https://api.github.com/repos/pydata/xarray/issues/4798,759456390,MDEyOklzc3VlQ29tbWVudDc1OTQ1NjM5MA==,7226087,2021-01-13T13:43:20Z,2021-01-13T13:43:20Z,NONE,"@kmuehlbauer thanks for finding that out!
Now I'm wondering if that should be documented or some other solution; certainly, for me it was surprising, but maybe also my expectations were just wrong.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,784484810
https://github.com/pydata/xarray/issues/4798#issuecomment-759435034,https://api.github.com/repos/pydata/xarray/issues/4798,759435034,MDEyOklzc3VlQ29tbWVudDc1OTQzNTAzNA==,5821660,2021-01-13T13:03:43Z,2021-01-13T13:04:49Z,MEMBER,"@mikapfl That's by design in netCDF4:
https://github.com/Unidata/netcdf4-python/blob/bcbe3a0c62e6aa012b7afe7c9b2cfc9b2abc5424/src/netCDF4/_netCDF4.pyx#L1478-L1482
```python
if len(result) == 1:
return result[0]
else:
return result
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,784484810
https://github.com/pydata/xarray/issues/4798#issuecomment-759397199,https://api.github.com/repos/pydata/xarray/issues/4798,759397199,MDEyOklzc3VlQ29tbWVudDc1OTM5NzE5OQ==,7226087,2021-01-13T11:47:39Z,2021-01-13T11:47:39Z,NONE,"Actually, this is a problem which is specific to the netcdf4 backend, using `h5netcdf`, this works:
```python
import xarray as xr
ds = xr.Dataset(attrs={""foo"": [""bar""]},)
ds.to_netcdf(""ds.nc"", engine=""h5netcdf"")
rd = xr.open_dataset(""ds.nc"", engine=""h5netcdf"")
assert ds.attrs[""foo""] == rd.attrs[""foo""]
```
and runs without problems.
As soon as I involve netcdf4 in reading or writing, this fails.
I don't know enough about netcdf's on-disk format to really debug what is going on. The `ncdump` output looks identical to me for both engines.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,784484810
https://github.com/pydata/xarray/issues/4798#issuecomment-758990368,https://api.github.com/repos/pydata/xarray/issues/4798,758990368,MDEyOklzc3VlQ29tbWVudDc1ODk5MDM2OA==,10194086,2021-01-12T21:05:19Z,2021-01-12T21:05:52Z,MEMBER,"There is an explicit condition for the size to be `> 1`
https://github.com/pydata/xarray/blob/f52a95cbe694336fe47bc5a42c713bee8ad74d64/xarray/backends/netCDF4_.py#L274-L275
However, even when setting the condition to `> 0` it is saved as a string and not as a list of strings - maybe check if this can be achieved with netCDF4 at all.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,784484810