home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where issue = 787502146 and user = 10194086 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

  • mathause · 2 ✖

issue 1

  • weighted: small improvements · 2 ✖

author_association 1

  • MEMBER 2
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
767565592 https://github.com/pydata/xarray/pull/4818#issuecomment-767565592 https://api.github.com/repos/pydata/xarray/issues/4818 MDEyOklzc3VlQ29tbWVudDc2NzU2NTU5Mg== mathause 10194086 2021-01-26T14:10:01Z 2021-01-26T14:10:01Z MEMBER

Finally figured it out - I had to use python T_DataWithCoords = TypeVar("T_DataWithCoords", bound="DataWithCoords") DataWithCoords is a parent class of Dastaset and DataArray. Now the following works:

```python import xarray as xr

da = xr.DataArray([1]) ds = xr.Dataset(data_vars={"x": da})

reveal_type(da.weighted(da).mean()) # Revealed type is 'xarray.core.dataarray.DataArray' reveal_type(ds.weighted(da).mean()) # Revealed type is 'xarray.core.dataarray.Dataset' ```

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  weighted: small improvements 787502146
765031152 https://github.com/pydata/xarray/pull/4818#issuecomment-765031152 https://api.github.com/repos/pydata/xarray/issues/4818 MDEyOklzc3VlQ29tbWVudDc2NTAzMTE1Mg== mathause 10194086 2021-01-22T00:33:39Z 2021-01-22T00:33:39Z MEMBER

The following now works well

python import xarray as xr da = xr.DataArray([1]) reveal_type(xr.core.weighted.DataArrayWeighted(da, da).mean())

However, what I cannot get to work is:

python reveal_type(da.weighted(da)) (returns Any). What almost works is:

```python def weighted(self: T_DSorDA, weights: "DataArray") -> Weighted[T_DSorDA]:

return self._weighted_cls(self, weights)

```

However, mypy does not like that I overwrite the type of self with T_DSorDA...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  weighted: small improvements 787502146

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