home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

2 rows where state = "closed", type = "issue" and user = 4441865 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 1

  • issue · 2 ✖

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
464717028 MDU6SXNzdWU0NjQ3MTcwMjg= 3081 Method chaining on magic methods? hsharrison 4441865 closed 0     2 2019-07-05T17:02:44Z 2019-07-09T19:28:11Z 2019-07-09T19:28:11Z CONTRIBUTOR      

Apologies if this has been discussed, I couldn't find it.

In pandas and xarray I prefer a method-chaining style, and with pandas this is now very well supported. However, xarray is missing a number of simple methods. I often find myself having to use magic methods like __eq__ directly to avoid breaking the chain. Is there any reason not to do

class DataArray:
    ...
    eq = __eq__
    gt = __gt__
    ge = __ge__
    lt = __lt__
    le = __le__
    add = __add__
    subtract = __sub__
    multiply = __mul__
    divide = __div__
    pow = __pow__
    # etc.

Probably it is more complicated than this, but hopefully it communicates the idea.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3081/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
209523348 MDU6SXNzdWUyMDk1MjMzNDg= 1281 update_attrs method hsharrison 4441865 closed 0     6 2017-02-22T17:23:51Z 2017-03-07T19:35:03Z 2017-03-07T19:35:03Z CONTRIBUTOR      

Updating attrs is an operation that consistently breaks up my method chaining. This should be easy to solve with something like

def update_attrs(self, *args, **kwargs): self.attrs.update(*args, **kwargs) return self

Thoughts?

edit: I guess it should return a modified object rather than acting as an in-place operation...is copying appropriate here? How is this usually handled?

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

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