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/7104#issuecomment-1263016285,https://api.github.com/repos/pydata/xarray/issues/7104,1263016285,IC_kwDOAMm_X85LSBld,23625371,2022-09-30T02:00:44Z,2022-09-30T02:00:44Z,CONTRIBUTOR,"Ok great thanks, solutions sound good","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1390228572
https://github.com/pydata/xarray/pull/5264#issuecomment-931822464,https://api.github.com/repos/pydata/xarray/issues/5264,931822464,IC_kwDOAMm_X843inuA,23625371,2021-10-01T01:27:24Z,2021-10-01T01:27:24Z,CONTRIBUTOR,@lewisjarednz fyi,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,877016428
https://github.com/pydata/xarray/pull/5264#issuecomment-931822417,https://api.github.com/repos/pydata/xarray/issues/5264,931822417,IC_kwDOAMm_X843intR,23625371,2021-10-01T01:27:15Z,2021-10-01T01:27:15Z,CONTRIBUTOR,@shoyer can I bother you again now that CI is passing please?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,877016428
https://github.com/pydata/xarray/pull/5776#issuecomment-927232092,https://api.github.com/repos/pydata/xarray/issues/5776,927232092,IC_kwDOAMm_X843RHBc,23625371,2021-09-26T04:59:24Z,2021-09-26T04:59:24Z,CONTRIBUTOR,"> The only other thing this needs is a test to check that the error is raised with the correct message (i.e. `pytest.raises(TypeError, match=""may fix this issue"")`
I believe that's covered by https://github.com/pydata/xarray/blob/ec2657bfc1a426aa3559243b02ecf48de6673506/xarray/tests/test_combine.py#L1109 (i.e. no change is needed to the existing code)","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,990509161
https://github.com/pydata/xarray/pull/5776#issuecomment-927108350,https://api.github.com/repos/pydata/xarray/issues/5776,927108350,IC_kwDOAMm_X843Qoz-,23625371,2021-09-25T11:35:37Z,2021-09-25T11:35:37Z,CONTRIBUTOR,"Alrighty updated, see what you think","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,990509161
https://github.com/pydata/xarray/pull/5776#issuecomment-914762048,https://api.github.com/repos/pydata/xarray/issues/5776,914762048,IC_kwDOAMm_X842hilA,23625371,2021-09-08T01:13:06Z,2021-09-08T01:13:06Z,CONTRIBUTOR,"We could try and tighten this up in a few ways (I'm not sure how much effort it is worth):
- only talk about cf_time if the error is in the time dimension (or if one of the types is `cftime.datetime`)
- only talk about cf_time if the function which tried to do the combining actually has this argument (e.g. `combine_by_coords` doesn't have `use_cftime`, only `open_mfdataset` does so the current implementation could be confusing), to do this I'd use a try except block further up the stack rather than altering the message in `_ensure_same_types`
Thoughts @mathause and @TomNicholas ?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,990509161
https://github.com/pydata/xarray/pull/5767#issuecomment-914754778,https://api.github.com/repos/pydata/xarray/issues/5767,914754778,IC_kwDOAMm_X842hgza,23625371,2021-09-08T01:06:28Z,2021-09-08T01:06:28Z,CONTRIBUTOR,"Thanks @TomNicholas and @mathause. I've opened a new PR (#5776), turns out all the tests are well setup already, I just needed to be told where to look. Cheers!","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,988426640
https://github.com/pydata/xarray/pull/5767#issuecomment-913098489,https://api.github.com/repos/pydata/xarray/issues/5767,913098489,IC_kwDOAMm_X842bMb5,23625371,2021-09-05T07:07:16Z,2021-09-05T07:07:16Z,CONTRIBUTOR,"> use_cftime=True
I knew there must be a more elegant option, thanks!","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,988426640
https://github.com/pydata/xarray/pull/5767#issuecomment-913089052,https://api.github.com/repos/pydata/xarray/issues/5767,913089052,IC_kwDOAMm_X842bKIc,23625371,2021-09-05T05:19:45Z,2021-09-05T05:19:45Z,CONTRIBUTOR,@mathause what do you think?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,988426640
https://github.com/pydata/xarray/pull/5264#issuecomment-882924370,https://api.github.com/repos/pydata/xarray/issues/5264,882924370,IC_kwDOAMm_X840oFtS,23625371,2021-07-19T23:19:01Z,2021-07-19T23:19:01Z,CONTRIBUTOR,Ignoring failing CI due to fsspec (see https://github.com/pydata/xarray/pull/5615#issuecomment-881679900),"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,877016428
https://github.com/pydata/xarray/pull/5264#issuecomment-879538970,https://api.github.com/repos/pydata/xarray/issues/5264,879538970,MDEyOklzc3VlQ29tbWVudDg3OTUzODk3MA==,23625371,2021-07-14T02:35:18Z,2021-07-14T02:35:18Z,CONTRIBUTOR,`xarray/tests/test_backends.py::test_open_fsspec` appears to fail because of the release of ffspec 2021.7.0 so this PR will probably have to wait until a fix for that is added (presumably elsewhere to keep the changes clear).,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,877016428
https://github.com/pydata/xarray/pull/5264#issuecomment-879533808,https://api.github.com/repos/pydata/xarray/issues/5264,879533808,MDEyOklzc3VlQ29tbWVudDg3OTUzMzgwOA==,23625371,2021-07-14T02:19:55Z,2021-07-14T02:20:27Z,CONTRIBUTOR,Something like 59ed7d5? (Obviously missing proper tests but just to get a sense of whether the idea is plausible),"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,877016428
https://github.com/pydata/xarray/pull/5264#issuecomment-879517988,https://api.github.com/repos/pydata/xarray/issues/5264,879517988,MDEyOklzc3VlQ29tbWVudDg3OTUxNzk4OA==,23625371,2021-07-14T01:41:38Z,2021-07-14T01:41:38Z,CONTRIBUTOR,I tried pushing a fix. It's unclear to me whether the change should be in how the dtypes are inferred (given that the inference code seems to do what it is meant to...) or whether `is_unicode_dtype` simply needs to be updated to know about `np.str_` (which is the fix I just tried).,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,877016428
https://github.com/pydata/xarray/pull/5264#issuecomment-833233473,https://api.github.com/repos/pydata/xarray/issues/5264,833233473,MDEyOklzc3VlQ29tbWVudDgzMzIzMzQ3Mw==,23625371,2021-05-06T05:21:19Z,2021-07-14T01:08:18Z,CONTRIBUTOR,"> What problem are you trying to solve here?
Somehow I ended up with `np.str_` in a pandas dataframe (how is unclear to me but this seems to be a valid string type), which then exploded when I converted to xarray and attempted to save as netCDF. Minimal example below.
```python
import numpy as np
import pandas as pd
# I don't know how the strings ended up being np.str_....
scenarios = [np.str_(v) for v in [""scenario_a"", ""scenario_b"", ""scenario_c""]]
years = range(2015, 2100 + 1)
tdf = pd.DataFrame(
data=np.random.random((len(scenarios), len(years))),
columns=years,
index=scenarios,
)
tdf.index.name = ""scenario""
tdf.columns.name = ""year""
tdf = tdf.stack()
tdf.name = ""tas""
txr = tdf.to_xarray()
# raises error shown below
txr.to_netcdf(""test.nc"")
# error
Traceback (most recent call last):
File ""scratch.py"", line 20, in
txr.to_netcdf(""test.nc"")
File "".../lib/python3.7/site-packages/xarray/core/dataarray.py"", line 2741, in to_netcdf
return dataset.to_netcdf(*args, **kwargs)
File "".../lib/python3.7/site-packages/xarray/core/dataset.py"", line 1699, in to_netcdf
invalid_netcdf=invalid_netcdf,
File "".../lib/python3.7/site-packages/xarray/backends/api.py"", line 1108, in to_netcdf
dataset, store, writer, encoding=encoding, unlimited_dims=unlimited_dims
File "".../lib/python3.7/site-packages/xarray/backends/api.py"", line 1154, in dump_to_store
store.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)
File "".../lib/python3.7/site-packages/xarray/backends/common.py"", line 256, in store
variables, check_encoding_set, writer, unlimited_dims=unlimited_dims
File "".../lib/python3.7/site-packages/xarray/backends/common.py"", line 294, in set_variables
name, v, check, unlimited_dims=unlimited_dims
File "".../lib/python3.7/site-packages/xarray/backends/netCDF4_.py"", line 464, in prepare_variable
variable, self.format, raise_on_invalid_encoding=check_encoding
File "".../lib/python3.7/site-packages/xarray/backends/netCDF4_.py"", line 131, in _get_datatype
datatype = _nc4_dtype(var)
File "".../lib/python3.7/site-packages/xarray/backends/netCDF4_.py"", line 154, in _nc4_dtype
raise ValueError(f""unsupported dtype for netCDF4 variable: {var.dtype}"")
ValueError: unsupported dtype for netCDF4 variable: object
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,877016428
https://github.com/pydata/xarray/pull/5264#issuecomment-848597492,https://api.github.com/repos/pydata/xarray/issues/5264,848597492,MDEyOklzc3VlQ29tbWVudDg0ODU5NzQ5Mg==,23625371,2021-05-26T08:58:23Z,2021-05-26T08:58:23Z,CONTRIBUTOR,"> I agree, this should totally work. It's not obvious to me how to best fix it, though.
I assume it's not as trivial as just changing e.g. https://github.com/pydata/xarray/blob/f9a535c130615fe81379d785dffcc6c814fc1126/xarray/coding/strings.py#L32 to also know about `np.str_`?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,877016428
https://github.com/pydata/xarray/pull/5264#issuecomment-848517059,https://api.github.com/repos/pydata/xarray/issues/5264,848517059,MDEyOklzc3VlQ29tbWVudDg0ODUxNzA1OQ==,23625371,2021-05-26T06:55:48Z,2021-05-26T06:55:48Z,CONTRIBUTOR,@shoyer any further thoughts on this now that the scope is clearer?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,877016428
https://github.com/pydata/xarray/pull/5264#issuecomment-833182029,https://api.github.com/repos/pydata/xarray/issues/5264,833182029,MDEyOklzc3VlQ29tbWVudDgzMzE4MjAyOQ==,23625371,2021-05-06T02:37:57Z,2021-05-06T02:37:57Z,CONTRIBUTOR,So far I've just added a single test which fails. I don't think the test should fail although I'm not sure what the `np.str_` type actually is so maybe this isn't a bug? Help/advice greatly appreciated.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,877016428
https://github.com/pydata/xarray/pull/5050#issuecomment-801871642,https://api.github.com/repos/pydata/xarray/issues/5050,801871642,MDEyOklzc3VlQ29tbWVudDgwMTg3MTY0Mg==,23625371,2021-03-18T12:02:09Z,2021-03-18T12:02:09Z,CONTRIBUTOR,"> If you can just add a what's new entry, I think this is ready to go!
Done, thanks!","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,834380377
https://github.com/pydata/xarray/pull/4506#issuecomment-716449448,https://api.github.com/repos/pydata/xarray/issues/4506,716449448,MDEyOklzc3VlQ29tbWVudDcxNjQ0OTQ0OA==,23625371,2020-10-26T10:15:07Z,2020-10-26T10:15:07Z,CONTRIBUTOR,Wicked thanks everyone! ,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,719881097
https://github.com/pydata/xarray/pull/4506#issuecomment-707520138,https://api.github.com/repos/pydata/xarray/issues/4506,707520138,MDEyOklzc3VlQ29tbWVudDcwNzUyMDEzOA==,23625371,2020-10-13T06:28:16Z,2020-10-13T06:28:16Z,CONTRIBUTOR,"I am not sure what is causing the CI failure, I don't think it's related to my changes","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,719881097