home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

2 rows where comments = 1, state = "open" and user = 500246 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

type 1

  • issue 2

state 1

  • open · 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
751732952 MDU6SXNzdWU3NTE3MzI5NTI= 4612 Assigning nan to int-dtype array converts nan to int gerritholl 500246 open 0     1 2020-11-26T17:00:45Z 2021-01-02T03:55:30Z   CONTRIBUTOR      

(I am almost sure this already exists as an issue, but I can't find the original)

What happened:

When assigning nan to a integer-dtype array, the nan gets incorrectly inverted to int.

What you expected to happen:

I expect to get a ValueError, like I get for pure numpy arrays.

Minimal Complete Verifiable Example:

python import xarray import numpy da = xarray.DataArray(numpy.array([0,1], dtype="u8")) da[0] = numpy.nan print(da)

Gives:

<xarray.DataArray (dim_0: 2)> array([9223372036854775808, 1], dtype=uint64) Dimensions without coordinates: dim_0

Anything else we need to know?:

In numpy the equivalent code raises ValueError

This is related but different from #2945. In #2945, xarray behaves the same as numpy. In #4612, xarray behaves differently from numpy.

Environment:

Output of <tt>xr.show_versions()</tt> INSTALLED VERSIONS ------------------ commit: None python: 3.8.6 | packaged by conda-forge | (default, Oct 7 2020, 19:08:05) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 4.12.14-lp150.12.82-default machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_GB.UTF-8 LOCALE: en_GB.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.16.1 pandas: 1.1.4 numpy: 1.19.4 scipy: 1.5.3 netCDF4: 1.5.4 pydap: None h5netcdf: 0.8.1 h5py: 3.1.0 Nio: None zarr: 2.5.0 cftime: 1.2.1 nc_time_axis: None PseudoNetCDF: None rasterio: 1.1.7 cfgrib: None iris: None bottleneck: None dask: 2.30.0 distributed: 2.30.1 matplotlib: 3.3.2 cartopy: 0.18.0 seaborn: None numbagg: None pint: None setuptools: 49.6.0.post20201009 pip: 20.2.4 conda: installed pytest: 6.1.2 IPython: 7.19.0 sphinx: 3.3.0
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4612/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue
410317757 MDU6SXNzdWU0MTAzMTc3NTc= 2772 Should xarray allow assigning a masked constant? gerritholl 500246 open 0     1 2019-02-14T14:10:20Z 2019-02-15T20:24:44Z   CONTRIBUTOR      

Currently, ds['a'] = ((), ma.masked) where ds is an xarray.Dataset gives ValueError: Could not convert tuple of form (dims, data[, attrs, encoding]): ((), masked) to Variable., whereas ds['a'] = (), ma.MaskedArray(0.0, True) works (it sets the indicated value to NaN). Should assigning ma.masked be equivalent to assigning ma.MaskedArray(0.0, True), or are there good reasons for the difference in behaviour?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2772/reactions",
    "total_count": 0,
    "+1": 0,
    "-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 22.443ms · About: xarray-datasette