home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 968796847 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 2

  • benbovy 2
  • dcherian 1

issue 1

  • Coerce the labels passed to Index.query to array-like objects · 3 ✖

author_association 1

  • MEMBER 3
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
908496157 https://github.com/pydata/xarray/issues/5697#issuecomment-908496157 https://api.github.com/repos/pydata/xarray/issues/5697 IC_kwDOAMm_X842Jo0d benbovy 4160723 2021-08-30T16:35:54Z 2021-08-30T16:35:54Z MEMBER

So does this mean custom indexes have to implement vectorized or pointwise indexing on their own?

No I don't think so (sorry my thoughts are still confusing), we would still use the current implementation in Xarray for positional (vectorized, pointwise, etc.) indexing.

Currently label-based indexers go through these normalization steps before passing them to Index.query:

  1. cast floating-point labels to coordinate dtype (maybe_cast_to_coords_dtype())
  2. convert DataArray objects to unlabelled data (via .variable.data)

The dimension (positional) indexers returned by Index.query may be also converted before passing them to .isel:

  1. back to Variable or DataArray objects for advanced indexing

I think that PandasIndex should take care of 1. Casting floating-point labels (casting any object to a numpy array as a side effect) may be undesirable for other, custom indexes.

For 2 and 3, I'm not exactly sure what to do. We should probably avoid 2 since dimension labels are useful (e.g., it is used in .xoak.sel) and let the indexes handle that. This means that indexes should also handle 3. For pandas multi-indexes, this would allow us raising a more meaningful error message since they don't support DataArray or Variable objects as level indexers. It is also better to handle 2 and 3 in a per-case basis since a general solution for 3 is tricky with the new data model (non-dimensional indexes).

This means a lot of flexibility for custom indexes but also a great responsibility.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Coerce the labels passed to Index.query to array-like objects 968796847
908453953 https://github.com/pydata/xarray/issues/5697#issuecomment-908453953 https://api.github.com/repos/pydata/xarray/issues/5697 IC_kwDOAMm_X842JehB dcherian 2448579 2021-08-30T15:46:50Z 2021-08-30T15:46:50Z MEMBER

leave indexers untouched and let Index objects do the validation and conversion.

So does this mean custom indexes have to implement vectorized or pointwise indexing on their own?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Coerce the labels passed to Index.query to array-like objects 968796847
908447693 https://github.com/pydata/xarray/issues/5697#issuecomment-908447693 https://api.github.com/repos/pydata/xarray/issues/5697 IC_kwDOAMm_X842Jc_N benbovy 4160723 2021-08-30T15:38:42Z 2021-08-30T15:38:42Z MEMBER

In #5692 (a551c7f) they are always coerced to arrays before maybe be converted as scalars.

This is not exactly true: slices are kept as-is.

3153 is actually a workaround specific to Pandas index limitations (only float64 floating -point labels supported), so it would make sense to move this within PandasIndex.

Other use-cases like xoak point-wise indexing only support Variable or DataArray objects as indexers (to ensure that all indexers have the same dimensions).

So it would probably be better to leave indexers untouched and let Index objects do the validation and conversion.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Coerce the labels passed to Index.query to array-like objects 968796847

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