home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 669162768

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/pull/4292#issuecomment-669162768 https://api.github.com/repos/pydata/xarray/issues/4292 669162768 MDEyOklzc3VlQ29tbWVudDY2OTE2Mjc2OA== 14808389 2020-08-05T12:25:10Z 2020-08-05T14:29:38Z MEMBER

you should be able to isolate this to just indexing.convert_label_indexer, e.g. with this in test_indexing.py: ```python def test_convert_label_indexer_datetime(self): index = pd.to_datetime(["2000-01-01", "2001-01-01", "2002-01-01"]) actual = indexing.convert_label_indexer(index, "2001-01-01") expected = (1, None) assert actual == expected

    actual = indexing.convert_label_indexer(index, index.to_numpy()[1])
    assert actual == expected

```

The failing tests are due to label[()] returning a numpy.str_ instead of a plain python str. Maybe we can fix that by using item as long as the dtype is not "datetime64" or "timedelta64": python if label.dtype.kind in "mM": label_value = label[()] else: label_value = label.item() Edit: stable is affected by this, too

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