home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 386596872 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 3

  • spencerkclark 1
  • Huite 1
  • stale[bot] 1

author_association 3

  • CONTRIBUTOR 1
  • MEMBER 1
  • NONE 1

issue 1

  • DataArray constructor still coerces to np.datetime64[ns], not cftime in 0.11.0 · 3 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
727710036 https://github.com/pydata/xarray/issues/2587#issuecomment-727710036 https://api.github.com/repos/pydata/xarray/issues/2587 MDEyOklzc3VlQ29tbWVudDcyNzcxMDAzNg== stale[bot] 26384082 2020-11-16T03:15:42Z 2020-11-16T03:15:42Z NONE

In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity

If this issue remains relevant, please comment here or remove the stale label; otherwise it will be marked as closed automatically

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray constructor still coerces to np.datetime64[ns], not cftime in 0.11.0 386596872
444071471 https://github.com/pydata/xarray/issues/2587#issuecomment-444071471 https://api.github.com/repos/pydata/xarray/issues/2587 MDEyOklzc3VlQ29tbWVudDQ0NDA3MTQ3MQ== Huite 13662783 2018-12-04T11:42:47Z 2018-12-04T11:42:58Z CONTRIBUTOR

Thanks, I'll indeed use cftime.datetime objects directly.

cftime.DatetimeProlepticGregorian seems the obvious default to me as well.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray constructor still coerces to np.datetime64[ns], not cftime in 0.11.0 386596872
443543672 https://github.com/pydata/xarray/issues/2587#issuecomment-443543672 https://api.github.com/repos/pydata/xarray/issues/2587 MDEyOklzc3VlQ29tbWVudDQ0MzU0MzY3Mg== spencerkclark 6628425 2018-12-02T21:26:50Z 2018-12-02T21:26:50Z MEMBER

Thanks for the clear report @Huite. Indeed we did not consider this particular use case when updating the behavior in version 0.11 (i.e. non-cftime dates passed to the DataArray constructor that are outside the np.datetime64[ns] range).

As you noted, in this situation it would probably make sense to coerce these dates to a cftime date type; specifically, I think the correct type to use would be cftime.DatetimeProlepticGregorian, because the Python documentation states that datetime.date (and by extension datetime.datetime) objects assume "the current Gregorian calendar always was, and always will be, in effect."

Note if you use cftime.datetime objects directly things work as you might expect: ``` In [1]: import cftime; import xarray

In [2]: times = [cftime.DatetimeProlepticGregorian(1000, 1, 1)]

In [3]: da = xarray.DataArray(times, dims=['time'], coords=[times])

In [4]: da Out[4]: <xarray.DataArray (time: 1)> array([cftime.DatetimeProlepticGregorian(1000, 1, 1, 0, 0, 0, 0, 0, 1)], dtype=object) Coordinates: * time (time) object 1000-01-01 00:00:00 ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray constructor still coerces to np.datetime64[ns], not cftime in 0.11.0 386596872

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