home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

2 rows where repo = 13221727 and user = 9049976 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

type 2

  • issue 1
  • pull 1

state 1

  • closed 2

repo 1

  • xarray · 2 ✖
id node_id number title user state locked assignee milestone comments created_at updated_at ▲ closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
859933298 MDU6SXNzdWU4NTk5MzMyOTg= 5171 Dask now supports item assignment. Shouldn't xarray support it too? tammasloughran 9049976 closed 0     2 2021-04-16T15:38:40Z 2021-05-01T23:35:44Z 2021-05-01T23:35:44Z CONTRIBUTOR      

As of a few weeks ago, dask now supports item assignment. Documentation here.

At the moment, xarray prevents item assignment if a DataArray uses dask arrays. ```

import xarray as xr foo = xr.DataArray([1,2,3,4,5,6], dims=('x'), coords={'x':[1,2,3,4,5,6]}).chunk(2) foo.loc[1] = 44 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/tammas/miniconda3/envs/da/lib/python3.8/site-packages/xarray/core/dataarray.py", line 213, in setitem self.data_array[pos_indexers] = value File "/home/tammas/miniconda3/envs/da/lib/python3.8/site-packages/xarray/core/dataarray.py", line 724, in setitem self.variable[key] = value File "/home/tammas/miniconda3/envs/da/lib/python3.8/site-packages/xarray/core/variable.py", line 889, in setitem indexable[index_tuple] = value File "/home/tammas/miniconda3/envs/da/lib/python3.8/site-packages/xarray/core/indexing.py", line 1379, in setitem raise TypeError( TypeError: this variable's data is stored in a dask array, which does not support item assignment. To assign to this variable, you must first load it into memory explicitly using the .load() method or accessing its .values attribute. ```

Now that this is possible in dask, shouldn't xarray allow it too if the installed dask version supports it?

Kind regards, Tam

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5171/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
860073545 MDExOlB1bGxSZXF1ZXN0NjE3MDQwNjIy 5174 Enable __setitem__ for dask versions that support it. tammasloughran 9049976 closed 0     13 2021-04-16T18:33:28Z 2021-05-01T19:59:37Z 2021-05-01T19:59:37Z CONTRIBUTOR   0 pydata/xarray/pulls/5174

The basics seem to work for me with just these changes. But I haven't tested much to see if it plays nicely with the rest of xarray. Looks like dask's item assignment is still mostly limited to 1D arrays and slices of multi dimensional arrays—no fancy stuff.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5174/reactions",
    "total_count": 4,
    "+1": 4,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 80.196ms · About: xarray-datasette