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/6226#issuecomment-1026754743,https://api.github.com/repos/pydata/xarray/issues/6226,1026754743,IC_kwDOAMm_X849Mwi3,10580038,2022-02-01T11:43:21Z,2022-02-01T11:44:32Z,CONTRIBUTOR,"Are we expecting the `CFTimeIndex` object to always have ""O"" as dtype? If so the solution would be straight forward. Which means I can create a PR.","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1120276279
https://github.com/pydata/xarray/issues/6226#issuecomment-1026656699,https://api.github.com/repos/pydata/xarray/issues/6226,1026656699,IC_kwDOAMm_X849MYm7,10580038,2022-02-01T09:52:39Z,2022-02-01T09:52:39Z,CONTRIBUTOR,"I just ran into the very same issue. Are you sure that this is a problem with pandas? I've had a look into the pandas changes between 1.3.X and 1.4.X. Apparently the [`_new_Index`](https://github.com/pandas-dev/pandas/blob/2bb20bbf594d93d2b09f345599c6f5a7245fdc66/pandas/core/indexes/base.py#L234) method, which gets involved when serialising the index object, has been changed:
```
elif ""dtype"" not in d and ""data"" in d:
# Prevent Index.__new__ from conducting inference;
# ""data"" key not in RangeIndex
d[""dtype""] = d[""data""].dtype
return cls.__new__(cls, **d)
```
the problem is, that [`__new__`](https://github.com/pydata/xarray/blob/86328a1cfe5296f8e478b17e52ba884db2384872/xarray/coding/cftimeindex.py#L313) doesn't except a `dtype` argument. I've tried adding a `dtype` argument and it works. So I guess since this class inherits from `pd.Index` it needs to be updated?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1120276279
https://github.com/pydata/xarray/issues/6226#issuecomment-1026580368,https://api.github.com/repos/pydata/xarray/issues/6226,1026580368,IC_kwDOAMm_X849MF-Q,6063709,2022-02-01T08:19:46Z,2022-02-01T08:31:17Z,CONTRIBUTOR,"Update: It is `pandas` that is the critical package. Pinning `distributed<2022.01.0`, `xarray<0.21.0` and `cftime<1.5.2` didn't fix it, but adding `pandas<1.4.0` makes the above test pass. Will now try unpinning other packages and confirm it is `pandas` that is the issue.
Edit: Confirmed it is `pandas==1.4.0` that causes this issue. Following version combination does not produce this error:
```
INSTALLED VERSIONS
------------------
commit: None
python: 3.9.10 | packaged by conda-forge | (main, Jan 30 2022, 18:04:04)
[GCC 9.4.0]
python-bits: 64
OS: Linux
OS-release: 4.18.0-348.2.1.el8.nci.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: en_AU.utf8
LANG: en_AU.ISO8859-1
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.10.6
libnetcdf: 4.7.4
xarray: 0.21.0
pandas: 1.3.5
numpy: 1.22.1
scipy: 1.7.3
netCDF4: 1.5.6
pydap: installed
h5netcdf: 0.13.1
h5py: 3.6.0
Nio: None
zarr: 2.10.3
cftime: 1.5.2
nc_time_axis: 1.4.0
PseudoNetCDF: None
rasterio: 1.2.6
cfgrib: 0.9.10.0
iris: 3.1.0
bottleneck: 1.3.2
dask: 2022.01.1
distributed: 2022.01.1
matplotlib: 3.5.1
cartopy: 0.19.0.post1
seaborn: 0.11.2
numbagg: None
fsspec: 2022.01.0
cupy: 10.1.0
pint: 0.18
sparse: 0.13.0
setuptools: 59.8.0
pip: 21.3.1
conda: 4.11.0
pytest: 6.2.5
IPython: 8.0.1
sphinx: 4.4.0
```","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1120276279