home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where issue = 800118528 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

  • doctest failure with numpy 1.20 · 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
773300501 https://github.com/pydata/xarray/issues/4858#issuecomment-773300501 https://api.github.com/repos/pydata/xarray/issues/4858 MDEyOklzc3VlQ29tbWVudDc3MzMwMDUwMQ== mathause 10194086 2021-02-04T13:23:59Z 2021-02-04T13:23:59Z MEMBER

Thanks for the other examples. Yes these now also raise an error with numpy 1.20. What still does not raise is the following

python arr[0, 0] = np.nan (because this gets converted to da.variable._data[0:1, 0:1] = np.array([np.nan]) (approximately).


My suggestion is:

  1. replace the example with arr.pad(x=1, constant_values=1.23456789) and mention that the float is cast to int (or would you leave the example away?)
  2. open a new issue to discuss the issue of assigning float to int
{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  doctest failure with numpy 1.20 800118528
773214721 https://github.com/pydata/xarray/issues/4858#issuecomment-773214721 https://api.github.com/repos/pydata/xarray/issues/4858 MDEyOklzc3VlQ29tbWVudDc3MzIxNDcyMQ== mathause 10194086 2021-02-04T10:48:27Z 2021-02-04T10:48:27Z MEMBER

@mark-boer @dcherian @max-sixty

  1. Should we be more clever about incompatible dtypes? (numpy is not) a. By raising an error? b. By casting arr? c. Add an argument for the behavior on incompatible dtypes?
  2. If not - is the numpy error explicit enough?
  3. Should we just remove the example or should we replace it with something like arr.pad(x=1, constant_values=1.5) and mention that 1.5 is cast to 1

Currently there are 3 different behaviors, depending on constant_values

```python import xarray as xr import numpy as np arr = xr.DataArray([5, 6, 7], coords=[("x", [0, 1, 2])])

arr.pad(x=1, constant_values=np.nan)

ValueError: cannot convert float NaN to integer

arr.pad(x=1, constant_values=None)

casts arr to float

arr.pad(x=1, constant_values=1.5)

casts constant_values to int

```

https://github.com/pydata/xarray/blob/5735e163bea43ec9bc3c2e640fbf25a1d4a9d0c0/xarray/core/dataarray.py#L3883-L3892

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  doctest failure with numpy 1.20 800118528

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