home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 400504690 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 2

  • spencerkclark 2
  • shoyer 1

issue 1

  • dropna() for a Series indexed by a CFTimeIndex · 3 ✖

author_association 1

  • MEMBER 3
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
458768265 https://github.com/pydata/xarray/issues/2688#issuecomment-458768265 https://api.github.com/repos/pydata/xarray/issues/2688 MDEyOklzc3VlQ29tbWVudDQ1ODc2ODI2NQ== spencerkclark 6628425 2019-01-30T00:54:01Z 2019-01-30T00:54:01Z MEMBER

Probably the easiest option would be to support boolean indexers directly in CFTimeIndex.get_value (by checking for a boolean dtype).

Good idea -- I'll see what I can do.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  dropna() for a Series indexed by a CFTimeIndex 400504690
458430492 https://github.com/pydata/xarray/issues/2688#issuecomment-458430492 https://api.github.com/repos/pydata/xarray/issues/2688 MDEyOklzc3VlQ29tbWVudDQ1ODQzMDQ5Mg== shoyer 1217238 2019-01-29T07:06:20Z 2019-01-29T07:06:20Z MEMBER

@spencerkclark Ugh, this part of pandas is a real mess. Probably the easiest option would be to support boolean indexers directly in CFTimeIndex.get_value (by checking for a boolean dtype).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  dropna() for a Series indexed by a CFTimeIndex 400504690
458101606 https://github.com/pydata/xarray/issues/2688#issuecomment-458101606 https://api.github.com/repos/pydata/xarray/issues/2688 MDEyOklzc3VlQ29tbWVudDQ1ODEwMTYwNg== spencerkclark 6628425 2019-01-28T11:50:21Z 2019-01-28T11:50:21Z MEMBER

The issue seems to stem from the fact that the TypeError produced by index.get_value(series, [True, False, True]) is not one of the exceptions that pandas.Series.__getitem__ is written to handle.

In the case of a DatetimeIndex, index.get_value(series, [True, False, True]) raises an InvalidIndexError in place of a TypeError initially raised: ``` In [1]: import xarray as xr; import pandas as pd; import numpy as np

In [2]: times = pd.date_range('2000', periods=3)

In [3]: series = pd.Series([0., np.nan, 1.], index=times)

In [4]: times.get_value(series, [True, False, True])

TypeError Traceback (most recent call last) ~/pandas/pandas/core/indexes/base.py in get_value(self, series, key) 4290 return self._engine.get_value(s, k, -> 4291 tz=getattr(series.dtype, 'tz', None)) 4292 except KeyError as e1:

~/pandas/pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_value()

~/pandas/pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_value()

~/pandas/pandas/_libs/index.pyx in pandas._libs.index.DatetimeEngine.get_loc()

TypeError:

During handling of the above exception, another exception occurred:

InvalidIndexError Traceback (most recent call last) <ipython-input-7-1b8f8313de2a> in <module> ----> 1 times.get_value(series, [True, False, True])

~/pandas/pandas/core/indexes/datetimes.py in get_value(self, series, key) 934 935 try: --> 936 return com.maybe_box(self, Index.get_value(self, series, key), 937 series, key) 938 except KeyError:

~/pandas/pandas/core/indexes/base.py in get_value(self, series, key) 4310 if is_scalar(key): # pragma: no cover 4311 raise IndexError(key) -> 4312 raise InvalidIndexError(key) 4313 4314 def set_value(self, arr, key, value):

InvalidIndexError: [True, False, True] `` This would seem to offer a simple fix for us forCFTimeIndex.get_value(i.e. catch theTypeErrorand raise anInvalidIndexError); however,InvalidIndexErrorunfortunately [is not a public exception](https://github.com/pandas-dev/pandas/blob/master/pandas/errors/__init__.py) in pandas. Raising aKeyErrorinstead happens to work, but I'm not sure if it's safe to rely on that either (because we're sort of at the whim of how it gets handled inSeries.getitem`).

@shoyer do you think you might have a recommendation here? Does either one of those options make sense, or might there be an alternative?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  dropna() for a Series indexed by a CFTimeIndex 400504690

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 1040.501ms · About: xarray-datasette