home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where issue = 683657289 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

  • shoyer 1
  • seth-p 1

author_association 2

  • CONTRIBUTOR 1
  • MEMBER 1

issue 1

  • Indexing a datetime64[ns] coordinate with a scalar datetime.date produces a KeyError · 2 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
695165172 https://github.com/pydata/xarray/issues/4363#issuecomment-695165172 https://api.github.com/repos/pydata/xarray/issues/4363 MDEyOklzc3VlQ29tbWVudDY5NTE2NTE3Mg== seth-p 7441788 2020-09-19T05:00:50Z 2020-09-19T05:00:50Z CONTRIBUTOR

Indeed, this is reported in https://github.com/pandas-dev/pandas/issues/35466#issuecomment-678407125 and https://github.com/pandas-dev/pandas/issues/35830. Also https://github.com/pandas-dev/pandas/pull/35478.

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Indexing a datetime64[ns] coordinate with a scalar datetime.date produces a KeyError 683657289
693120404 https://github.com/pydata/xarray/issues/4363#issuecomment-693120404 https://api.github.com/repos/pydata/xarray/issues/4363 MDEyOklzc3VlQ29tbWVudDY5MzEyMDQwNA== shoyer 1217238 2020-09-16T01:47:13Z 2020-09-16T01:47:13Z MEMBER

This doesn't work in pandas either: ``` In [8]: x.to_series().loc[dt.date(2010, 1, 1)]


KeyError Traceback (most recent call last) <ipython-input-8-148c4a8380fa> in <module> ----> 1 x.to_series().loc[dt.date(2010, 1, 1)]

~/miniconda3/envs/xarray-py38/lib/python3.8/site-packages/pandas/core/indexing.py in getitem(self, key) 877 878 maybe_callable = com.apply_if_callable(key, self.obj) --> 879 return self._getitem_axis(maybe_callable, axis=axis) 880 881 def _is_scalar_access(self, key: Tuple):

~/miniconda3/envs/xarray-py38/lib/python3.8/site-packages/pandas/core/indexing.py in _getitem_axis(self, key, axis) 1108 # fall thru to straight lookup 1109 self._validate_key(key, axis) -> 1110 return self._get_label(key, axis=axis) 1111 1112 def _get_slice_axis(self, slice_obj: slice, axis: int):

~/miniconda3/envs/xarray-py38/lib/python3.8/site-packages/pandas/core/indexing.py in _get_label(self, label, axis) 1057 def _get_label(self, label, axis: int): 1058 # GH#5667 this will fail if the label is not present in the axis. -> 1059 return self.obj.xs(label, axis=axis) 1060 1061 def _handle_lowerdim_multi_index_axis0(self, tup: Tuple):

~/miniconda3/envs/xarray-py38/lib/python3.8/site-packages/pandas/core/generic.py in xs(self, key, axis, level, drop_level) 3480 loc, new_index = self.index.get_loc_level(key, drop_level=drop_level) 3481 else: -> 3482 loc = self.index.get_loc(key) 3483 3484 if isinstance(loc, np.ndarray):

~/miniconda3/envs/xarray-py38/lib/python3.8/site-packages/pandas/core/indexes/datetimes.py in get_loc(self, key, method, tolerance) 620 else: 621 # unrecognized type --> 622 raise KeyError(key) 623 624 try:

KeyError: datetime.date(2010, 1, 1) ```

I think it is reasonable to expect a date object to work like a date string, but I would suggest fixing this in pandas first (inside DatetimeIndex.get_loc), at which point it should automatically work for xarray.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Indexing a datetime64[ns] coordinate with a scalar datetime.date produces a KeyError 683657289

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 13.216ms · About: xarray-datasette