home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 711022646

This data as json

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/4516#issuecomment-711022646 https://api.github.com/repos/pydata/xarray/issues/4516 711022646 MDEyOklzc3VlQ29tbWVudDcxMTAyMjY0Ng== 6628425 2020-10-17T14:42:42Z 2020-10-17T14:44:21Z MEMBER

Indeed a bisect reveals pandas-dev/pandas#37087 was the cause: ``` abd3acf05516611e9e90d57ae363f1567e30f49a is the first bad commit commit abd3acf05516611e9e90d57ae363f1567e30f49a Author: Terji Petersen contribute@tensortable.com Date: Wed Oct 14 13:26:45 2020 +0100

CLN: clean Index._id (#37087)

pandas/core/indexes/base.py | 21 +++++++++++++-------- pandas/core/indexes/multi.py | 4 +++- pandas/tests/arithmetic/test_object.py | 3 ++- 3 files changed, 18 insertions(+), 10 deletions(-) ```

I think it's that _id used to automatically be initialized to None and now it needs to be explicitly initialized within the constructor. They added some try-except logic in the is_ method to handle the case where _id has not been initialized, but there's an error happening now within the view method. Here's a more minimal example:

``` In [1]: import xarray as xr

In [2]: xr.cftime_range("2000", periods=2).view()

AttributeError Traceback (most recent call last) <ipython-input-2-5226cd5e3bc1> in <module> ----> 1 xr.cftime_range("2000", periods=2).view()

~/Software/pandas/pandas/core/indexes/base.py in view(self, cls) 630 result = self._shallow_copy() 631 if isinstance(result, Index): --> 632 result._id = self._id 633 return result 634

AttributeError: 'CFTimeIndex' object has no attribute '_id' ```

I'll have to think about things a little more to see if we should pursue an upstream fix or whether we can address it in xarray.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  723181209
Powered by Datasette · Queries took 0.761ms · About: xarray-datasette