home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where issue = 759270347 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 3

  • keewis 2
  • max-sixty 1
  • BorjaEst 1

author_association 2

  • MEMBER 3
  • NONE 1

issue 1

  • RecursionError when defining __slots__ on subclass using Containment · 4 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
763427539 https://github.com/pydata/xarray/issues/4660#issuecomment-763427539 https://api.github.com/repos/pydata/xarray/issues/4660 MDEyOklzc3VlQ29tbWVudDc2MzQyNzUzOQ== BorjaEst 47473455 2021-01-20T08:27:01Z 2021-01-20T08:27:01Z NONE

Sorry for my long time to reply, christmas... @keewis thank you a lot for your anwer, I am glad to hear subclass might be supported one day. At the end, those are the python tools the programmers we work with.

For the moment, I will try to implement Extending xarray as you pointed using "xr.register_dataset_accessor". Create a new class that cannot be identified as 'isinstance(object, xarray.Dataset)' might be an issue in my case.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  RecursionError when defining __slots__ on subclass using Containment 759270347
758347487 https://github.com/pydata/xarray/issues/4660#issuecomment-758347487 https://api.github.com/repos/pydata/xarray/issues/4660 MDEyOklzc3VlQ29tbWVudDc1ODM0NzQ4Nw== max-sixty 5635139 2021-01-12T02:13:15Z 2021-01-12T02:13:15Z MEMBER

Though we don't support it officially, I've found subclassing a Dataset can be useful when adding methods. Most operations on the object will not persist the subclass, though.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  RecursionError when defining __slots__ on subclass using Containment 759270347
758312392 https://github.com/pydata/xarray/issues/4660#issuecomment-758312392 https://api.github.com/repos/pydata/xarray/issues/4660 MDEyOklzc3VlQ29tbWVudDc1ODMxMjM5Mg== keewis 14808389 2021-01-12T00:31:01Z 2021-01-12T00:31:01Z MEMBER

I assume this answered your question. If you disagree, feel free to reopen.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  RecursionError when defining __slots__ on subclass using Containment 759270347
743486313 https://github.com/pydata/xarray/issues/4660#issuecomment-743486313 https://api.github.com/repos/pydata/xarray/issues/4660 MDEyOklzc3VlQ29tbWVudDc0MzQ4NjMxMw== keewis 14808389 2020-12-11T23:52:36Z 2020-12-11T23:52:36Z MEMBER

inheriting from a Dataset or DataArray is not something we support right now, although that might change in the future.

The reason your examples fail with a RecursionError is a different one, though, you also get the same error if you remove all references to xarray and pass a string to your class. As pointed out in the SO question you referenced, you need to change your __init__: ```python class MyClass: slots = ("dataset",)

def __init__(self, ds):
    self.__class__.dataset.__set__(self, ds)

def __getattr__(self, k):
    return getattr(self.dataset, k)

def __setattr__(self, k, v):
    setattr(self.dataset, k, v)

ds = xr.Dataset() x = MyClass(ds) `` but I've also seen the use ofnewinstead ofinit` to avoid this somewhat ugly trick.

Be aware that the result of __getattr__ as it is right now will remove the custom class, so if you would like to avoid that you will have to add some sort of check: python def __getattr__(self, k): result = getattr(self.dataset, k) if isinstance(result, (xr.Dataset, xr.DataArray)): return type(self)(result) else: return result

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  RecursionError when defining __slots__ on subclass using Containment 759270347

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