home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

2 rows where type = "pull" and user = 548266 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

  • pull · 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
1924487457 PR_kwDOAMm_X85bzzXe 8268 Add extra overload for to_netcdf jenshnielsen 548266 closed 0     3 2023-10-03T16:15:10Z 2023-12-04T07:04:39Z 2023-12-03T18:24:54Z CONTRIBUTOR   0 pydata/xarray/pulls/8268

The current signature does not match with pyright if a non-literal bool is passed.

This fixes type checking of code like this:

```python import xarray as xr

def myfunc(compute: bool) -> None: ds = xr.Dataset() ds.to_netcdf(path="myfile.nc", compute=compute) ``` with pyright.

See https://github.com/microsoft/pyright/issues/6069 for context.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8268/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
813246980 MDExOlB1bGxSZXF1ZXN0NTc3NDI1Njcy 4941 Use definition of DTypeLike from Numpy if found jenshnielsen 548266 closed 0     5 2021-02-22T08:06:40Z 2021-02-23T19:31:14Z 2021-02-23T19:20:55Z CONTRIBUTOR   0 pydata/xarray/pulls/4941

This allows application of numpy ufuncs to DataArrays to typecheck correctly with Numpy 1.20

E.g. without this fix:

``` import xarray as xr import numpy as np

def applyufunctodataarray() -> xr.DataArray: a = xr.DataArray(np.array([-1,2,3])) b = np.abs(a) return b ```

will result in:

test.py:9: error: Argument 1 to "__call__" of "ufunc" has incompatible type "DataArray"; expected "Union[Union[int, float, complex, str, bytes, generic], Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], _SupportsArray]" Found 1 error in 1 file (checked 1 source file) While it will type check without issues with this fix.

I have not yet documented this or added tests. Please let me know if this change is acceptable and I am happy to do that.

  • [ ] Tests added
  • [x] Passes pre-commit run --all-files
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4941/reactions",
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 1,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull

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