home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 532878771 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 4

  • dcherian 2
  • mathause 2
  • max-sixty 1
  • TomNicholas 1

issue 1

  • xr.Dataset.map drops attrs of DataArray · 6 ✖

author_association 1

  • MEMBER 6
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
564555360 https://github.com/pydata/xarray/issues/3595#issuecomment-564555360 https://api.github.com/repos/pydata/xarray/issues/3595 MDEyOklzc3VlQ29tbWVudDU2NDU1NTM2MA== TomNicholas 35968931 2019-12-11T14:02:06Z 2019-12-13T10:59:28Z MEMBER

When I wrote the (set_options) keep_attrs switch in then I intended it to function as a global switch, so ensuring that individual DataArray attrs are also propagated fits with that intention. I just apparently never thought of this case.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xr.Dataset.map drops attrs of DataArray 532878771
562654276 https://github.com/pydata/xarray/issues/3595#issuecomment-562654276 https://api.github.com/repos/pydata/xarray/issues/3595 MDEyOklzc3VlQ29tbWVudDU2MjY1NDI3Ng== max-sixty 5635139 2019-12-06T17:00:23Z 2019-12-06T17:00:23Z MEMBER

(forgive me, am on vacation)

I actually didn't know about the multiple levels of attrs. Given that does exist, I agree with @dcherian re keep_attrs impacting individual variable attrs too.

While it is a behavior change, I think it's fine: the current behavior is somewhere between a bug and an undocumented artefact. Unless others see a more material change here?

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xr.Dataset.map drops attrs of DataArray 532878771
561819897 https://github.com/pydata/xarray/issues/3595#issuecomment-561819897 https://api.github.com/repos/pydata/xarray/issues/3595 MDEyOklzc3VlQ29tbWVudDU2MTgxOTg5Nw== dcherian 2448579 2019-12-04T20:13:57Z 2019-12-04T20:13:57Z MEMBER

I think that it's sensible that keep_attrs controls whether individual variable attrs are kept after mapping a function on each variable.

This is a behaviour change though. I'm not sure how to deal with that.

cc @max-sixty

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xr.Dataset.map drops attrs of DataArray 532878771
561812950 https://github.com/pydata/xarray/issues/3595#issuecomment-561812950 https://api.github.com/repos/pydata/xarray/issues/3595 MDEyOklzc3VlQ29tbWVudDU2MTgxMjk1MA== mathause 10194086 2019-12-04T19:54:57Z 2019-12-04T19:54:57Z MEMBER

Sorry, read before you edited - I can try to add a PR if you agree to change this behavior.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xr.Dataset.map drops attrs of DataArray 532878771
561812227 https://github.com/pydata/xarray/issues/3595#issuecomment-561812227 https://api.github.com/repos/pydata/xarray/issues/3595 MDEyOklzc3VlQ29tbWVudDU2MTgxMjIyNw== mathause 10194086 2019-12-04T19:53:06Z 2019-12-04T19:53:06Z MEMBER

Yes, it works for the Dataset-level attrs and the docstring also specifies that:

keep_attrs : bool, optional If True, the dataset's attributes (`attrs`) will be copied from the original object to the new one. If False, the new object will be returned without attributes.

So the question is more if this is the expected behaviour?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xr.Dataset.map drops attrs of DataArray 532878771
561810709 https://github.com/pydata/xarray/issues/3595#issuecomment-561810709 https://api.github.com/repos/pydata/xarray/issues/3595 MDEyOklzc3VlQ29tbWVudDU2MTgxMDcwOQ== dcherian 2448579 2019-12-04T19:49:00Z 2019-12-04T19:52:10Z MEMBER

Looking at the code, keep_attrs controls whether the dataset attrs are kept, not the invidual variable attrs.

https://github.com/pydata/xarray/blob/577d3a75ea8bb25b99f9d31af8da14210cddff78/xarray/core/dataset.py#L4233-L4240

This may be fixable by threading keep_attrs down through maybe_wrap_array and then ultimately to Variable.__array_wrap__ when you can choose to keep attrs if keep_attrs is True.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xr.Dataset.map drops attrs of DataArray 532878771

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