issues: 502720385
This data as json
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
502720385 | MDU6SXNzdWU1MDI3MjAzODU= | 3374 | Key error in to_netcdf | 6943441 | closed | 0 | 5 | 2019-10-04T16:04:30Z | 2023-03-14T21:14:33Z | 2023-03-14T21:14:33Z | NONE | MCVE Code Sample```python import xarray as xr p = range(10) ds = xr.Dataset({'precip': (['time'], p)}, coords={'time': range(10)}) ds.attrs['Conventions'] = ['COARDS', 'GrADS'] ds.to_netcdf('a.nc') ``` Expected OutputSaves data to Problem DescriptionIn version
If instead the attribute is saved as as string instead of a list, it works: ```python import xarray as xr p = range(10) ds = xr.Dataset({'precip': (['time'], p)}, coords={'time': range(10)}) ds.attrs['Conventions'] = "['COARDS', 'GrADS']" ds.to_netcdf('a.nc') ``` Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3374/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |