home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where author_association = "MEMBER", issue = 253975242 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 · 3 ✖

issue 1

  • Boolean indexing 'by' xr.DataArray · 3 ✖

author_association 1

  • MEMBER · 3 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
326157538 https://github.com/pydata/xarray/issues/1537#issuecomment-326157538 https://api.github.com/repos/pydata/xarray/issues/1537 MDEyOklzc3VlQ29tbWVudDMyNjE1NzUzOA== shoyer 1217238 2017-08-31T00:44:41Z 2017-08-31T00:44:41Z MEMBER

OK, here we go: ``` In [25]: class GoodWrappedArray(object): ...: def init(self, array): ...: self.array = array ...: def array(self, dtype=None): ...: return np.asarray(self.array, dtype) ...: def getitem(self, key): ...: return self.array[key] ...: def len(self): ...: return len(self.array) ...:

In [26]: ind = GoodWrappedArray(np.array([True, False, True]))

In [27]: np.arange(3)[ind] Out[27]: array([0, 2])

In [28]: class BadWrappedArray(object): ...: def init(self, array): ...: self.array = array ...: def array(self, dtype=None): ...: return np.asarray(self.array, dtype) ...: def getitem(self, key): ...: return BadWrappedArray(self.array[key]) ...: def len(self): ...: return len(self.array) ...:

In [29]: ind = BadWrappedArray(np.array([True, False, True]))

In [30]: np.arange(3)[ind] Out[32]: array([], shape=(0, 3), dtype=int64) ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Boolean indexing 'by' xr.DataArray 253975242
326157080 https://github.com/pydata/xarray/issues/1537#issuecomment-326157080 https://api.github.com/repos/pydata/xarray/issues/1537 MDEyOklzc3VlQ29tbWVudDMyNjE1NzA4MA== shoyer 1217238 2017-08-31T00:41:25Z 2017-08-31T00:41:25Z MEMBER

Two more clues:

LazilyIndexedArray suffices to duplicate this issue: ``` In [20]: ind = xr.core.indexing.LazilyIndexedArray(np.array([True, False, True]))

In [21]: np.arange(3)[ind] Out[21]: array([], shape=(0, 3), dtype=int64) ```

But this simple array wrapper does not: ``` In [17]: class WrappedArray(object): ...: def init(self, array): ...: self.array = array ...: def array(self, dtype=None): ...: return np.asarray(self.array, dtype) ...: def getitem(self, key): ...: return WrappedArray(self.array[key]) ...: @property ...: def shape(self): ...: return self.array.shape ...: @property ...: def dtype(self): ...: return self.array.dtype ...:

In [18]: ind = WrappedArray(np.array([True, False, True]))

In [19]: np.arange(3)[ind] Out[19]: array([0, 2]) ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Boolean indexing 'by' xr.DataArray 253975242
326037970 https://github.com/pydata/xarray/issues/1537#issuecomment-326037970 https://api.github.com/repos/pydata/xarray/issues/1537 MDEyOklzc3VlQ29tbWVudDMyNjAzNzk3MA== shoyer 1217238 2017-08-30T16:01:32Z 2017-08-30T16:01:32Z MEMBER

I think this is probably an upstream (numpy) bug. Indexing a NumPy array by an array-like object should be equivalent to casting it to a numpy array, i.e., array[np.asarray(ind)].

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Boolean indexing 'by' xr.DataArray 253975242

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