home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

5 rows where user = 7788154 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

type 2

  • pull 4
  • issue 1

state 2

  • closed 4
  • open 1

repo 1

  • xarray 5
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
2260280862 PR_kwDOAMm_X85tjH8m 8967 Migrate datatreee assertions/extensions/formatting owenlittlejohns 7788154 closed 0     0 2024-04-24T04:23:03Z 2024-04-26T17:38:59Z 2024-04-26T17:29:18Z CONTRIBUTOR   0 pydata/xarray/pulls/8967

This PR continues the overall work of migrating DataTree into xarray.

  • xarray/core/datatree_render.py is the renamed version of xarray/datatree_/datatree/render.py.
  • xarray/core/extensions.py now contains functionality from xarray/datatree_/datatree/extensions.py.
  • xarray/core/formatting.py now contains functionality from xarray/datatree_/datatree/formatting.py.
  • xarray/tests/test_datatree.py now contains tests from xarray/datatree_/datatree/tests/test_dataset_api.py.
  • xarray/testing/assertions.py now contains functionality from /xarray/datatree_/datatree/testing.py.

I had also meant to get to common.py and what's left of io.py, but I've got a hefty couple of days of meetings ahead, so I wanted to get this progress into PR before that happens. @flamingbear or I can follow up with the remaining things in a separate PR. (Also this PR is already getting a little big, so maybe it's already got enough in it)

  • [x] Contributes to migration step for miscellaneous modules in #8572
  • [ ] ~~Tests added~~
  • [ ] ~~User visible changes (including notable bug fixes) are documented in whats-new.rst~~
  • [ ] ~~New functions/methods are listed in api.rst~~
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8967/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2246986030 PR_kwDOAMm_X85s2plY 8948 Migrate datatree mapping.py owenlittlejohns 7788154 closed 0     1 2024-04-16T22:36:48Z 2024-04-17T20:44:29Z 2024-04-17T19:59:34Z CONTRIBUTOR   0 pydata/xarray/pulls/8948

This PR continues the overall work of migrating DataTree into xarray.

datatree_mapping.py is the renamed version of mapping.py from the datatree repository.

  • [x] Closes migration step for mapping.py #8572
  • [ ] ~~Tests added~~
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] ~~New functions/methods are listed in api.rst~~
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8948/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2208982027 PR_kwDOAMm_X85q1Lns 8879 Migrate iterators.py for datatree. owenlittlejohns 7788154 closed 0     2 2024-03-26T18:14:53Z 2024-04-15T16:23:56Z 2024-04-11T15:28:25Z CONTRIBUTOR   0 pydata/xarray/pulls/8879

This PR continues the overall work of migrating DataTree into xarray.

iterators.py does not have direct tests. In discussions with @TomNicholas and @flamingbear, we concurred that other unit tests utilise this functionality.

  • [x] Closes migration step for iterators.py #8572
  • [ ] ~~Tests added~~
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] ~~New functions/methods are listed in api.rst~~
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8879/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2157719606 PR_kwDOAMm_X85oGzPp 8789 Migrate datatree.py module into xarray.core. owenlittlejohns 7788154 closed 0     4 2024-02-27T22:27:16Z 2024-03-26T17:15:40Z 2024-03-26T16:05:52Z CONTRIBUTOR   0 pydata/xarray/pulls/8789

This PR migrates the datatree.py module to xarray/core/datatree.py, as part of the on-going effort to merge xarray-datatree into xarray itself.

Most of the changes are import path changes, and type-hints, but there is one minor change to the methods available on the DataTree class: to_array has been converted to to_dataarray, to align with the method on Dataset. (See conversation here)

This PR was initially published as a draft here.

  • [x] Completes migration step for datatree/datatree.py https://github.com/pydata/xarray/issues/8572
  • [x] Tests added
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8789/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
2195718932 I_kwDOAMm_X86C4AMU 8855 DatasetView class breaks Liskov's rule. owenlittlejohns 7788154 open 0     2 2024-03-19T18:38:30Z 2024-03-19T19:13:17Z   CONTRIBUTOR      

What is your issue?

Working on migrating the datatree.py module into xarray/core revealed that the DatasetView class, which implements Dataset while disabling methods to mutate the object, breaks Liskov's substitution principle. The type for one of the overloads of DatasetView.__getitem__ is more general than the corresponding Dataset.__getitem__ signature (due to the use of Self in the Dataset signature).

```

In Dataset:

class Dataset(...): ... @overload def getitem(self, key: Iterable[Hashable]) -> Self: ... ```

The use of Self means that signature inherited from the superclass has a return type of DatasetView, but the DatasetView signature is overridden to have a return type of Dataset (the more generalised parent).

To avoid this, a couple of implementations were attempted:

  • A class that tries to intercept the methods that mutate the Dataset using getattr. This does not catch the __setitem__ method, as it is a Magic Method, and those aren't affected by getattr.
  • A Metaclass that can intercept Magic Methods, too. Implementation was inspired from here. I didn't get it to fully work, and eventually realised this was getting too complicated given the scope of the original problem.
  • A mix-in for the mutating methods. I couldn't get this to work in the timescale agreed upon.
  • Resorting back to ignoring the mypy errors for now, so we can proceed with the migration (given that there isn't a significant implementation concern identified from these type issues).

Also note, there is a tangentially-related known mypy error when a property setter accepts an argument of a different type to the property itself (https://github.com/python/mypy/issues/3004). This affects the assignment of Dataset objects to the DataTree.ds property. (Separate issue, but related)

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8855/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    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 3758.993ms · About: xarray-datasette