home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where issue = 535812301 and user = 13301940 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

  • andersy005 · 2 ✖

issue 1

  • Timedelta dt accessor does not work · 2 ✖

author_association 1

  • MEMBER 2
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
564707090 https://github.com/pydata/xarray/issues/3609#issuecomment-564707090 https://api.github.com/repos/pydata/xarray/issues/3609 MDEyOklzc3VlQ29tbWVudDU2NDcwNzA5MA== andersy005 13301940 2019-12-11T19:57:11Z 2019-12-11T19:57:11Z MEMBER

@dcherian, Thank you for chiming in! Are there any other issues with discussions about implementation for Timedelta functionality? I am happy to take a stab at implementing this.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Timedelta dt accessor does not work 535812301
564704057 https://github.com/pydata/xarray/issues/3609#issuecomment-564704057 https://api.github.com/repos/pydata/xarray/issues/3609 MDEyOklzc3VlQ29tbWVudDU2NDcwNDA1Nw== andersy005 13301940 2019-12-11T19:49:18Z 2019-12-11T19:51:12Z MEMBER

1) Per Pandas documentation, the following are the defined attributes for Timedelta:

asm8 | Return a numpy timedelta64 array scalar view. -- | -- components | Return a components namedtuple-like. days | Number of days. delta | Return the timedelta in nanoseconds (ns), for internal compatibility. microseconds | Number of microseconds (>= 0 and less than 1 second). nanoseconds | Return the number of nanoseconds (n), where 0 <= n < 1 microsecond. resolution | Return a string representing the lowest timedelta resolution. resolution_string | Return a string representing the lowest timedelta resolution. seconds | Number of seconds (>= 0 and less than 1 day).

and since xarray coerces the dataarray to a Pandas Series prior accessing the requested attribute, calling start_t.dt.second fails.

2) Since seconds is a defined attribute for pandas.TimeDelta, I expect start_t.dt.seconds to work. However, it fails:

```python In [33]: start_t.dt.seconds


AttributeError Traceback (most recent call last) <ipython-input-33-e1e0943720f8> in <module> ----> 1 start_t.dt.seconds

AttributeError: 'DatetimeAccessor' object has no attribute 'seconds' ``` This is likely a bug in xarray.

3) Pandas appears to be establishing differences between DatetimeProperties and TimedeltaProperties:

```python In [16]: start_t_series.dt Out[16]: <pandas.core.indexes.accessors.TimedeltaProperties object at 0x7f2afafd45c0>

In [17]: dt_array_series.dt Out[17]: <pandas.core.indexes.accessors.DatetimeProperties object at 0x7f2bf7ccd320> ```

Xarray, on the other hand, seems to be treating them the same:

```python In [18]: dt_array.dt Out[18]: <xarray.core.accessor_dt.DatetimeAccessor at 0x7f2afb6e8710>

In [19]: start_t.dt Out[19]: <xarray.core.accessor_dt.DatetimeAccessor at 0x7f2afb6a20f0> ```

  • Should xarray establish differences between DatetimeProperties and TimedeltaProperties??
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Timedelta dt accessor does not work 535812301

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