home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

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

  • jthielen 1
  • russ-schumacher 1

author_association 2

  • CONTRIBUTOR 1
  • NONE 1

issue 1

  • trouble slicing on sub-minute dataset · 2 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
793256439 https://github.com/pydata/xarray/issues/5012#issuecomment-793256439 https://api.github.com/repos/pydata/xarray/issues/5012 MDEyOklzc3VlQ29tbWVudDc5MzI1NjQzOQ== russ-schumacher 18426375 2021-03-09T01:49:35Z 2021-03-09T01:49:35Z NONE

good catch! I'm not sure why the model would've written it out this way, but the original dataset (along with the small subset I wrote out and attached) is indeed non-monotonic in the non-working example. That is strange but is almost certainly the reason for the error. This'll help me do what I need to do, and I'm not sure whether this is so much of an edge case that it's even worth a bigger fix.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  trouble slicing on sub-minute dataset 825079209
793204639 https://github.com/pydata/xarray/issues/5012#issuecomment-793204639 https://api.github.com/repos/pydata/xarray/issues/5012 MDEyOklzc3VlQ29tbWVudDc5MzIwNDYzOQ== jthielen 3460034 2021-03-09T00:38:37Z 2021-03-09T00:39:02Z CONTRIBUTOR

I'll leave the exact issue up to someone more acquainted with string and slice handling on TimedeltaIndex, but in case it is useful, here are two things I noticed (to hopefully speed along the troubleshooting):

1) Using pandas Timedeltas instead of strings (i.e., ds.sel(time=slice(pd.Timedelta("01:00:00"), pd.Timedelta("01:15:00")))) works, giving

<xarray.Dataset> Dimensions: (time: 39, yh: 1, zh: 1) Coordinates: xh float32 ... * yh (yh) float32 0.0 * zh (zh) float32 0.0 * time (time) timedelta64[ns] 01:00:00 01:07:30 ... 01:14:30 01:15:00 Data variables: (12/26) x (time) float32 ... y (time) float32 ... z (time) float32 ... u (time) float32 ... v (time) float32 ... w (time) float32 ... ... ... b (time) float32 ... vpg (time) float32 ... zvort (time) float32 ... rho (time) float32 ... qsl (time) float32 ... qsi (time) float32 ... Attributes: CM1 version: cm1r20.1 Conventions: CF-1.7 missing_value: -999999.9

However, notice that jump in the time coordinate...which leads to

2) In the failing example, the time coordinate is non-monotonic. If we .sortby('time'), then ds.sel(time=slice("01:00:00","01:15:00")) works as expected:

<xarray.Dataset> Dimensions: (time: 47, yh: 1, zh: 1) Coordinates: xh float32 1.0 * yh (yh) float32 0.0 * zh (zh) float32 0.0 * time (time) timedelta64[ns] 01:00:00 01:00:30 ... 01:15:00 01:15:30 Data variables: (12/26) x (time) float32 ... y (time) float32 ... z (time) float32 ... u (time) float32 ... v (time) float32 ... w (time) float32 ... ... ... b (time) float32 ... vpg (time) float32 ... zvort (time) float32 ... rho (time) float32 ... qsl (time) float32 ... qsi (time) float32 ... Attributes: CM1 version: cm1r20.1 Conventions: CF-1.7 missing_value: -999999.9

(the working example also has a monotonic time coordinate)

And so, I would guess this is an example of string-based timedelta selection failing on non-monotonic coordinates.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  trouble slicing on sub-minute dataset 825079209

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