home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where author_association = "MEMBER" and issue = 409906674 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

  • shoyer 2
  • dcherian 1
  • max-sixty 1

issue 1

  • xarray .count() gives -1 when it should be 1? · 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
464190675 https://github.com/pydata/xarray/issues/2770#issuecomment-464190675 https://api.github.com/repos/pydata/xarray/issues/2770 MDEyOklzc3VlQ29tbWVudDQ2NDE5MDY3NQ== dcherian 2448579 2019-02-15T20:37:34Z 2019-02-15T20:37:34Z MEMBER

Though for datetime64 we should use ~np.nat?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xarray .count() gives -1 when it should be 1?  409906674
464189040 https://github.com/pydata/xarray/issues/2770#issuecomment-464189040 https://api.github.com/repos/pydata/xarray/issues/2770 MDEyOklzc3VlQ29tbWVudDQ2NDE4OTA0MA== shoyer 1217238 2019-02-15T20:31:15Z 2019-02-15T20:31:15Z MEMBER

Apparently isnull(datetime64_scalar_array) returns a Python boolean False. This gets inverted by ~ to -1 instead of True in our implementation of count: https://github.com/pydata/xarray/blob/4cd56a9edb083a3eb8d11e7a367dfb9bda76fc2e/xarray/core/duck_array_ops.py#L188

To fix this, we should either switch ~x to np.logical_not(x).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xarray .count() gives -1 when it should be 1?  409906674
464188585 https://github.com/pydata/xarray/issues/2770#issuecomment-464188585 https://api.github.com/repos/pydata/xarray/issues/2770 MDEyOklzc3VlQ29tbWVudDQ2NDE4ODU4NQ== shoyer 1217238 2019-02-15T20:29:25Z 2019-02-15T20:29:25Z MEMBER

The problem seems to come up for scalar datetime64 arrays: ```

xarray.Variable((), np.datetime64('2000-01-01')).count() -1 ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xarray .count() gives -1 when it should be 1?  409906674
463327251 https://github.com/pydata/xarray/issues/2770#issuecomment-463327251 https://api.github.com/repos/pydata/xarray/issues/2770 MDEyOklzc3VlQ29tbWVudDQ2MzMyNzI1MQ== max-sixty 5635139 2019-02-13T19:10:38Z 2019-02-13T19:10:38Z MEMBER

Thanks for the issue @ru111

That does seem weird. Do you have a minimally reproducible example?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xarray .count() gives -1 when it should be 1?  409906674

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