home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where issue = 326205036 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 · 4 ✖

issue 1

  • How should Dataset.update() handle conflicting coordinates? · 4 ✖

author_association 1

  • MEMBER 4
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
391932929 https://github.com/pydata/xarray/issues/2180#issuecomment-391932929 https://api.github.com/repos/pydata/xarray/issues/2180 MDEyOklzc3VlQ29tbWVudDM5MTkzMjkyOQ== shoyer 1217238 2018-05-25T03:46:40Z 2018-05-25T03:46:40Z MEMBER

Looking at @crusaderky's example of different coordinate labels again, I finally remember why it works this way.

The logic of ds.update(other) is that (1) variables explicitly listed in other should take precedence over the original object and (2) mutating a Dataset should not change its dimensions or indexes.

This is pretty clearly expressed in the original code: return merge_core([dataset, other], priority_arg=1, indexes=dataset.indexes)

In @crusaderky's example with fridge.update(shopping), shopping first gets reindexed to fridge (which means it ends up only holding NaN), and is then used to override the original dataset: <xarray.Dataset> Dimensions: (fruit: 1) Coordinates: * fruit (fruit) object 'apples' quality (fruit) object nan Data variables: fruits (fruit) float64 nan It would probably make sense to keep values from the original variables rather than blindly replacing them with the new NaNs from shopping, but in general I do think the general approach of "right join on variables" and "left join on indexes" makes sense for update().

For most use cases, the true outer join makes more sense -- which is why xarray.merge() works that way.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  How should Dataset.update() handle conflicting coordinates? 326205036
391908821 https://github.com/pydata/xarray/issues/2180#issuecomment-391908821 https://api.github.com/repos/pydata/xarray/issues/2180 MDEyOklzc3VlQ29tbWVudDM5MTkwODgyMQ== shoyer 1217238 2018-05-25T00:50:58Z 2018-05-25T00:51:10Z MEMBER

@crusaderky this behavior you show is indeed really strange. I don't know why alignment of dimensions works that way currently.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  How should Dataset.update() handle conflicting coordinates? 326205036
391908588 https://github.com/pydata/xarray/issues/2180#issuecomment-391908588 https://api.github.com/repos/pydata/xarray/issues/2180 MDEyOklzc3VlQ29tbWVudDM5MTkwODU4OA== shoyer 1217238 2018-05-25T00:49:15Z 2018-05-25T00:49:15Z MEMBER

OK, looking at this more carefully ds.update(other) didn't actually change when other is a Dataset, because ds[k] = ds[k].drop(coord_names) doesn't actually drop coordinates from a Dataset. It just shows a warning now, due to iteration over a Dataset.

So maybe we can leave the current behavior as is for now (but remove the warning).

What did change is how we handle conflicts in __setitem__ (which was intentional), and how we handle conflicts in update when the new value is a dictionary (which was not intentional, but at least remained consistent with __setitem__).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  How should Dataset.update() handle conflicting coordinates? 326205036
391898293 https://github.com/pydata/xarray/issues/2180#issuecomment-391898293 https://api.github.com/repos/pydata/xarray/issues/2180 MDEyOklzc3VlQ29tbWVudDM5MTg5ODI5Mw== shoyer 1217238 2018-05-24T23:40:34Z 2018-05-24T23:40:41Z MEMBER

cc @fujiisoup @crusaderky

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  How should Dataset.update() handle conflicting coordinates? 326205036

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