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/5148#issuecomment-818821420,https://api.github.com/repos/pydata/xarray/issues/5148,818821420,MDEyOklzc3VlQ29tbWVudDgxODgyMTQyMA==,367900,2021-04-13T15:20:50Z,2021-04-13T15:29:54Z,CONTRIBUTOR,"I've changed the title. > I think improving the error message is the way to go. Agreed. ~~Just playing with it, the attributes also need to be strings for netCDF (I'm not familiar with the other backends) so an equivalent error message should be added for them.~~ There is already a good error message for attributes, at least for netCDF, I wasn't looking at it properly.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,856900805 https://github.com/pydata/xarray/issues/5148#issuecomment-818809386,https://api.github.com/repos/pydata/xarray/issues/5148,818809386,MDEyOklzc3VlQ29tbWVudDgxODgwOTM4Ng==,14808389,2021-04-13T15:05:02Z,2021-04-13T15:05:43Z,MEMBER,"> I guess they could either convert to string or a better error message I think improving the error message is the way to go. > would you prefer to close this I think we can keep the discussion here","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,856900805 https://github.com/pydata/xarray/issues/5148#issuecomment-818800250,https://api.github.com/repos/pydata/xarray/issues/5148,818800250,MDEyOklzc3VlQ29tbWVudDgxODgwMDI1MA==,367900,2021-04-13T14:53:14Z,2021-04-13T14:55:03Z,CONTRIBUTOR,"This is also something that the backends will need to consider: ```python traceback >>> xr.DataArray(np.ones(5)).rename(dim_0=1).to_netcdf(""/tmp/test.nc"") ... /usr/lib/python3.9/site-packages/xarray/backends/netCDF4_.py in set_dimension(self, name, length, is_unlimited) 439 def set_dimension(self, name, length, is_unlimited=False): 440 dim_length = length if not is_unlimited else None --> 441 self.ds.createDimension(name, size=dim_length) 442 443 def set_attribute(self, key, value): src/netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Dataset.createDimension() src/netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Dimension.__init__() TypeError: expected bytes, int found ``` I guess they could either convert to string (which will result in a different array when loaded) or a better error message (``netCDF files only support strings for dimension names`` or similar).","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,856900805 https://github.com/pydata/xarray/issues/5148#issuecomment-818800770,https://api.github.com/repos/pydata/xarray/issues/5148,818800770,MDEyOklzc3VlQ29tbWVudDgxODgwMDc3MA==,367900,2021-04-13T14:53:55Z,2021-04-13T14:53:55Z,CONTRIBUTOR,Should I change the title here to be more general or would you prefer to close this and continue discussion in the other issue you linked?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,856900805 https://github.com/pydata/xarray/issues/5148#issuecomment-818734171,https://api.github.com/repos/pydata/xarray/issues/5148,818734171,MDEyOklzc3VlQ29tbWVudDgxODczNDE3MQ==,14808389,2021-04-13T13:25:54Z,2021-04-13T13:29:27Z,MEMBER,"we do want to allow general hashables to mirror the general `dict` object (and we do need it for some methods, like `to_unstacked_dataset`), but this is obviously nothing well tested. The main issue is that right now we sort `Dataset` dims and would need to be able to convert the keys to something comparable. See also #2173, where I suggested to convert to `str`. This might be too naive for immutable objects without a custom `__str__` / `__repr__`, so something like this, maybe: ```python sorted(self.mapping, key=lambda k: (type(k).__qualname__, str(k))) ``` which would group objects with the same type name together","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,856900805