home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 313010564 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 3

  • gajomi 2
  • shoyer 2
  • mangecoeur 1

author_association 2

  • CONTRIBUTOR 3
  • MEMBER 2

issue 1

  • Keeping attributes when using DataArray.astype · 5 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
584701023 https://github.com/pydata/xarray/issues/2049#issuecomment-584701023 https://api.github.com/repos/pydata/xarray/issues/2049 MDEyOklzc3VlQ29tbWVudDU4NDcwMTAyMw== mangecoeur 743508 2020-02-11T15:47:28Z 2020-02-11T15:48:08Z CONTRIBUTOR

Just run into this issue, present in 0.15, also does not respect the option keep_attrs=True

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Keeping attributes when using DataArray.astype 313010564
383267324 https://github.com/pydata/xarray/issues/2049#issuecomment-383267324 https://api.github.com/repos/pydata/xarray/issues/2049 MDEyOklzc3VlQ29tbWVudDM4MzI2NzMyNA== gajomi 244887 2018-04-21T04:39:29Z 2018-04-21T04:39:29Z CONTRIBUTOR

Above PR is a first draft. It would seem that the kwargs for the dask array method are a subset of the numpy array method, so I based docstring on these. Happy to do something else though if that makes sense.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Keeping attributes when using DataArray.astype 313010564
381661771 https://github.com/pydata/xarray/issues/2049#issuecomment-381661771 https://api.github.com/repos/pydata/xarray/issues/2049 MDEyOklzc3VlQ29tbWVudDM4MTY2MTc3MQ== shoyer 1217238 2018-04-16T16:15:50Z 2018-04-16T16:15:50Z MEMBER

OK, sounds good with adding this to Variable, too. It's the internal data structure that we build most of xarray's higher level labeled arrays on: http://xarray.pydata.org/en/stable/internals.html#variable-objects

Feel free to open an incomplete PR with your current progress and I am happy to advise

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Keeping attributes when using DataArray.astype 313010564
381651747 https://github.com/pydata/xarray/issues/2049#issuecomment-381651747 https://api.github.com/repos/pydata/xarray/issues/2049 MDEyOklzc3VlQ29tbWVudDM4MTY1MTc0Nw== gajomi 244887 2018-04-16T15:46:00Z 2018-04-16T15:47:18Z CONTRIBUTOR

I have a version of this working, but to get tests to pass I had to add the same behavior for Variable types (as the method was no longer being added from NUMPY_UNARY_METHODS). I don't think I have a very good picture of the proper use of Variables in the internal api, so I wasn't sure if it made sense to extend the behavior therein. Also I should say that on the first pass I had to do this outside of the apply_ufunc mechanism, as apply_ufunc doesn't keep attrs for Variables (thus inspiring my question above).

Just let me know if that makes sense or what alternative path seems best and I'll see if I can open a PR.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Keeping attributes when using DataArray.astype 313010564
380178000 https://github.com/pydata/xarray/issues/2049#issuecomment-380178000 https://api.github.com/repos/pydata/xarray/issues/2049 MDEyOklzc3VlQ29tbWVudDM4MDE3ODAwMA== shoyer 1217238 2018-04-10T17:12:32Z 2018-04-10T17:12:32Z MEMBER

We should probably just update astype() to preserve attributes.

Note: currently astype is directly assigning a method onto Dataset/DataArray (ugh!). https://github.com/pydata/xarray/blob/dc3eebf3a514cfdc1039b63f2a542121d1328ba9/xarray/core/ops.py#L39

It should really be switched to use a more transparent definition, e.g., a method defined in a base class, with the implementation defined by using apply_ufunc: https://github.com/pydata/xarray/blob/6402391cf206fd04c12d44773fecd9b42ea0c246/xarray/core/common.py#L748

This would make it quite easy to add keep_attrs=True.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Keeping attributes when using DataArray.astype 313010564

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