home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where author_association = "MEMBER", issue = 765639913 and user = 14808389 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 1

  • keewis · 7 ✖

issue 1

  • keep attrs in xarray.where · 7 ✖

author_association 1

  • MEMBER · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1003544001 https://github.com/pydata/xarray/pull/4687#issuecomment-1003544001 https://api.github.com/repos/pydata/xarray/issues/4687 IC_kwDOAMm_X8470N3B keewis 14808389 2022-01-01T11:16:38Z 2022-01-02T21:30:36Z MEMBER

I believe it is best to allow customizing the behavior, so I added a keep_attrs parameter. I named the parameter keep_attrs but it could just as well be called combine_attrs (not sure which is better?) It defaults to dropping the attrs (keep_attrs=False) and will keep the attrs of x for keep_attrs=True. Because we're using apply_ufunc under the hood any value accepted by merge_attrs can be passed, with the only difference being that keep_attrs=True is not equal to keep_attrs="override".

Edit: using a different keep_attrs handler does not affect the name of the resulting object. Because this potentially seems like a breaking change I would do that change in a different PR if we think it is important.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  keep attrs in xarray.where 765639913
920110705 https://github.com/pydata/xarray/pull/4687#issuecomment-920110705 https://api.github.com/repos/pydata/xarray/issues/4687 IC_kwDOAMm_X84218Zx keewis 14808389 2021-09-15T15:13:02Z 2021-09-16T16:31:54Z MEMBER

yes, that's the plan (we changed the keep_attrs to affect both data / data variables and coordinates in a earlier release, although that's not consistent yet), but I'm surprised to hear that xr.where didn't drop attrs in 0.17.

I'm a bit busy right now, but once things calm down a bit I'll try to finish this.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  keep attrs in xarray.where 765639913
822747072 https://github.com/pydata/xarray/pull/4687#issuecomment-822747072 https://api.github.com/repos/pydata/xarray/issues/4687 MDEyOklzc3VlQ29tbWVudDgyMjc0NzA3Mg== keewis 14808389 2021-04-19T20:01:57Z 2021-04-19T20:01:57Z MEMBER

I'm hoping to wait until combine_attrs is in apply_ufunc, so this is blocked by #5041

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  keep attrs in xarray.where 765639913
773700137 https://github.com/pydata/xarray/pull/4687#issuecomment-773700137 https://api.github.com/repos/pydata/xarray/issues/4687 MDEyOklzc3VlQ29tbWVudDc3MzcwMDEzNw== keewis 14808389 2021-02-05T00:40:45Z 2021-02-05T01:22:46Z MEMBER

Is that because apply_ufunc(..., keep_attrs=True) keeps the attrs of the first argument?

yes, exactly. However, I think it would be easier to extend keep_attrs as described in https://github.com/pydata/xarray/issues/3891#issuecomment-773693380 and allow passing keep_attrs to xr.where.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  keep attrs in xarray.where 765639913
751895498 https://github.com/pydata/xarray/pull/4687#issuecomment-751895498 https://api.github.com/repos/pydata/xarray/issues/4687 MDEyOklzc3VlQ29tbWVudDc1MTg5NTQ5OA== keewis 14808389 2020-12-28T23:30:53Z 2020-12-28T23:30:53Z MEMBER

I would think the closest match is to return from x — that's the equivalent of x.where(cond, other=y?

I'm not sure how to implement that: I can get there by replacing duck_array_ops.where with duck_array_ops.where_method, but that yields a different dimension order after broadcasting (for the doctest examples ["y", "x"] instead of ["x", "y"]). This might not be that much of an issue since we generally tell people to use transpose before applying a function that depends on the order, though.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  keep attrs in xarray.where 765639913
744708707 https://github.com/pydata/xarray/pull/4687#issuecomment-744708707 https://api.github.com/repos/pydata/xarray/issues/4687 MDEyOklzc3VlQ29tbWVudDc0NDcwODcwNw== keewis 14808389 2020-12-14T21:02:52Z 2020-12-14T21:02:52Z MEMBER

yes, that's true. Maybe that's why we did not propagate the attrs before, even though it is really easy to implement?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  keep attrs in xarray.where 765639913
744655107 https://github.com/pydata/xarray/pull/4687#issuecomment-744655107 https://api.github.com/repos/pydata/xarray/issues/4687 MDEyOklzc3VlQ29tbWVudDc0NDY1NTEwNw== keewis 14808389 2020-12-14T19:20:39Z 2020-12-14T19:24:02Z MEMBER

After thinking about this some more, I decided that it would be good to have the behavior of where mirror the behavior of DataArray.where, Dataset.where, and Variable.where. Should we want to be able to control this using set_options we should do so for all them at once.

I also added a entry to whats-new.rst, but I'm not sure about putting this into Breaking changes. Is Bug fixes more appropriate?

Edit: it seems this also preserves the name of cond, which might not be what we want.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  keep attrs in xarray.where 765639913

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