home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 582904457

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/3751#issuecomment-582904457 https://api.github.com/repos/pydata/xarray/issues/3751 582904457 MDEyOklzc3VlQ29tbWVudDU4MjkwNDQ1Nw== 6628425 2020-02-06T13:25:47Z 2020-02-06T13:34:51Z MEMBER

Part of the hazard of using a pd.Index subclass I suppose...

It looks like https://github.com/pandas-dev/pandas/pull/31511 was the cause of the issue: ``` $ git bisect good 64336ff8414f8977ff94adb9a5bc000a3a4ef454 is the first bad commit commit 64336ff8414f8977ff94adb9a5bc000a3a4ef454 Author: Kevin Anderson 57452607+kanderso-nrel@users.noreply.github.com Date: Sun Feb 2 20:48:28 2020 -0700

BUG: fix reindexing with a tz-aware index and method='nearest' (#31511)

doc/source/whatsnew/v1.1.0.rst | 2 +- pandas/core/indexes/base.py | 5 ++--- pandas/tests/frame/indexing/test_indexing.py | 10 ++++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) `` A way to fix this upstream would be to make sure thattargethas the same type as the index (here it is a genericpd.Indexinstead of aCFTimeIndex`), but I'm not sure how hard that would be (or if it makes sense in all cases): https://github.com/pandas-dev/pandas/blob/a2a35a86c4064d297c8b48ecfea80e9f05e27712/pandas/core/indexes/base.py#L3080

I think it's possible we could work around this in xarray. It comes down to properly recognizing what to do when you subtract a generic pd.Index of cftime.datetime objects from a CFTimeIndex. Previously this code in pandas operated strictly using NumPy arrays, so there was no casting issue when doing the subtraction.

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