home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where issue = 322591813 and user = 1217238 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • shoyer · 4 ✖

issue 1

  • cftime.datetime serialization example failing in latest doc build · 4 ✖

author_association 1

  • MEMBER 4
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
388887212 https://github.com/pydata/xarray/issues/2127#issuecomment-388887212 https://api.github.com/repos/pydata/xarray/issues/2127 MDEyOklzc3VlQ29tbWVudDM4ODg4NzIxMg== shoyer 1217238 2018-05-14T16:53:54Z 2018-05-14T16:53:54Z MEMBER

Yes, let's use pd.to_timedelta. Please mention https://github.com/numpy/numpy/issues/11096 in a comment in the code -- hopefully this should be fixed in the next NumPy release (1.15?).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  cftime.datetime serialization example failing in latest doc build 322591813
388694419 https://github.com/pydata/xarray/issues/2127#issuecomment-388694419 https://api.github.com/repos/pydata/xarray/issues/2127 MDEyOklzc3VlQ29tbWVudDM4ODY5NDQxOQ== shoyer 1217238 2018-05-14T04:32:43Z 2018-05-14T04:32:43Z MEMBER

Any multiple of 7 days (one week) seems to trigger it, e.g., ``` In [133]: np.array([datetime.timedelta(7)], dtype='timedelta64[D]')


TypeError Traceback (most recent call last) <ipython-input-133-92f07e97d8dc> in <module>() ----> 1 np.array([datetime.timedelta(7)], dtype='timedelta64[D]')

TypeError: Cannot cast datetime.timedelta object from metadata [Y] to [D] according to the rule 'same_kind' ```

For now, maybe try casting each element individually to np.timedelta64 as a work-around? e.g., In [139]: np.array([np.timedelta64(d, 'ns') for d in uniques.tolist()]) Out[139]: array([2419200000000000, 2592000000000000, 2678400000000000], dtype='timedelta64[ns]')

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  cftime.datetime serialization example failing in latest doc build 322591813
388690389 https://github.com/pydata/xarray/issues/2127#issuecomment-388690389 https://api.github.com/repos/pydata/xarray/issues/2127 MDEyOklzc3VlQ29tbWVudDM4ODY5MDM4OQ== shoyer 1217238 2018-05-14T03:59:07Z 2018-05-14T03:59:07Z MEMBER

This must be a NumPy bug. Here's an even simpler reproduction: ``` import numpy as np import datetime

np.array([datetime.timedelta(28)], dtype='timedelta64[D]')

TypeError: Cannot cast datetime.timedelta object from metadata [Y] to [D] according to the rule 'same_kind'

```

Any other day I've tried works. Also, the following code works (at least on my laptop): In [113]: np.array([datetime.timedelta(27)], dtype='timedelta64[D]'), np.array([datetime.timedelta(28)], dtype='timedelta64[D]') Out[113]: (array([27], dtype='timedelta64[D]'), array([28], dtype='timedelta64[D]'))

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  cftime.datetime serialization example failing in latest doc build 322591813
388660865 https://github.com/pydata/xarray/issues/2127#issuecomment-388660865 https://api.github.com/repos/pydata/xarray/issues/2127 MDEyOklzc3VlQ29tbWVudDM4ODY2MDg2NQ== shoyer 1217238 2018-05-13T22:35:19Z 2018-05-13T22:35:19Z MEMBER

I haven't looked into this in detail, but my guess is that this is somehow related to NumPy refusing to convert a timedelta that includes years or months into nanoseconds, because years and months can have different numbers of days.

To help debug this, it would be helpful to know exactly what the input dates is.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  cftime.datetime serialization example failing in latest doc build 322591813

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