home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 486153978 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 2

  • shoyer 2
  • griverat 1

author_association 2

  • MEMBER 2
  • CONTRIBUTOR 1

issue 1

  • Raise proper error for scalar array when coords is a dict · 3 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
526277546 https://github.com/pydata/xarray/pull/3271#issuecomment-526277546 https://api.github.com/repos/pydata/xarray/issues/3271 MDEyOklzc3VlQ29tbWVudDUyNjI3NzU0Ng== shoyer 1217238 2019-08-29T17:10:03Z 2019-08-29T17:10:03Z MEMBER

Looks great, thank you!

(We don't really need release notes for every minor change, especially if nothing is changing from a user perspective.)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Raise proper error for scalar array when coords is a dict 486153978
525832695 https://github.com/pydata/xarray/pull/3271#issuecomment-525832695 https://api.github.com/repos/pydata/xarray/issues/3271 MDEyOklzc3VlQ29tbWVudDUyNTgzMjY5NQ== griverat 23618263 2019-08-28T16:59:10Z 2019-08-28T16:59:10Z CONTRIBUTOR

I think this could be achieved by checking len(dims) == len(shape) in the case where dims was explicitly provided, i.e., around this line:

Thanks for the suggestion. The raise now happens if len(dims) != len(shape) near the line you suggested.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Raise proper error for scalar array when coords is a dict 486153978
525610905 https://github.com/pydata/xarray/pull/3271#issuecomment-525610905 https://api.github.com/repos/pydata/xarray/issues/3271 MDEyOklzc3VlQ29tbWVudDUyNTYxMDkwNQ== shoyer 1217238 2019-08-28T06:58:40Z 2019-08-28T06:58:40Z MEMBER

ValueError: conflicting sizes for dimension 'x': length 0 on the data but length 4 on coordinate 'x' seems like an improvement, but I'm still not sure it's the right message.

Maybe something like ValueError: different number of dimensions on data and dims: 0 vs 3 would be more precise?

I think this could be achieved by checking len(dims) == len(shape) in the case where dims was explicitly provided, i.e., around this line: https://github.com/pydata/xarray/blob/aaeea6250b89e3605ee1d1a160ad50d6ed657c7e/xarray/core/dataarray.py#L117

For reference, here's the current traceback for this error: ``` In [3]: xr.DataArray(np.array(1), coords={'x': np.arange(4), 'y': 'a'}, dims=['x'])


KeyError Traceback (most recent call last) <ipython-input-3-68fe094298fd> in <module> ----> 1 xr.DataArray(np.array(1), coords={'x': np.arange(4), 'y': 'a'}, dims=['x'])

~/dev/xarray/xarray/core/dataarray.py in init(self, data, coords, dims, name, attrs, encoding, indexes, fastpath) 344 data = _check_data_shape(data, coords, dims) 345 data = as_compatible_data(data) --> 346 coords, dims = _infer_coords_and_dims(data.shape, coords, dims) 347 variable = Variable(dims, data, attrs, encoding, fastpath=True) 348

~/dev/xarray/xarray/core/dataarray.py in _infer_coords_and_dims(shape, coords, dims) 140 141 for d, s in zip(v.dims, v.shape): --> 142 if s != sizes[d]: 143 raise ValueError( 144 "conflicting sizes for dimension %r: "

KeyError: 'x' ```

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Raise proper error for scalar array when coords is a dict 486153978

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