home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where author_association = "MEMBER" and issue = 166441031 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 3

  • crusaderky 3
  • shoyer 2
  • benbovy 1

issue 1

  • unstack() treats string coords as objects · 6 ✖

author_association 1

  • MEMBER · 6 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1259415318 https://github.com/pydata/xarray/issues/907#issuecomment-1259415318 https://api.github.com/repos/pydata/xarray/issues/907 IC_kwDOAMm_X85LEScW benbovy 4160723 2022-09-27T12:11:35Z 2022-09-27T12:11:35Z MEMBER

This is fixed in v2022.6.0. Xarray's PandasMultiIndex wrapper keeps track of the level coordinate dtypes.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  unstack() treats string coords as objects 166441031
459771318 https://github.com/pydata/xarray/issues/907#issuecomment-459771318 https://api.github.com/repos/pydata/xarray/issues/907 MDEyOklzc3VlQ29tbWVudDQ1OTc3MTMxOA== crusaderky 6213168 2019-02-01T16:00:24Z 2019-02-01T16:00:24Z MEMBER

This issue is still valid as of xarray 0.11.0

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  unstack() treats string coords as objects 166441031
234686788 https://github.com/pydata/xarray/issues/907#issuecomment-234686788 https://api.github.com/repos/pydata/xarray/issues/907 MDEyOklzc3VlQ29tbWVudDIzNDY4Njc4OA== crusaderky 6213168 2016-07-23T00:24:38Z 2016-07-23T00:24:38Z MEMBER

Yes that works as well

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  unstack() treats string coords as objects 166441031
234685394 https://github.com/pydata/xarray/issues/907#issuecomment-234685394 https://api.github.com/repos/pydata/xarray/issues/907 MDEyOklzc3VlQ29tbWVudDIzNDY4NTM5NA== shoyer 1217238 2016-07-23T00:09:21Z 2016-07-23T00:09:21Z MEMBER

Does array.coords[dim] = array.coords[dim].values.astype(str) work? In theory, I think it should...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  unstack() treats string coords as objects 166441031
234685251 https://github.com/pydata/xarray/issues/907#issuecomment-234685251 https://api.github.com/repos/pydata/xarray/issues/907 MDEyOklzc3VlQ29tbWVudDIzNDY4NTI1MQ== crusaderky 6213168 2016-07-23T00:07:38Z 2016-07-23T00:07:38Z MEMBER

Crude workaround:

``` python

Convert object coords to string

for dim in array.dims: if array.coords[dim].dtype == numpy.dtype('O'): array.coords[dim] = array.coords[dim].values.tolist()

return array ```

The above works, but if you have more than a handful elements in the coord the performance hit will be severe.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  unstack() treats string coords as objects 166441031
234434065 https://github.com/pydata/xarray/issues/907#issuecomment-234434065 https://api.github.com/repos/pydata/xarray/issues/907 MDEyOklzc3VlQ29tbWVudDIzNDQzNDA2NQ== shoyer 1217238 2016-07-22T01:50:06Z 2016-07-22T01:50:22Z MEMBER

This is a tricky one to fix. Stack is not the only operation that can convert string arrays to dtype=object -- reindex and align also do this.

The challenge is that NumPy does not support variable width strings or strings with missing values. Hence, we end up with dtype=object arrays.

In this particular case, we could preserve the string dtype by keeping track of the original dtype of the arrays at go into a MultiIndex as metadata, similar to how we currently use PandasIndexAdapter to preserve the original dtype on arrays converted into non-multi indexes.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  unstack() treats string coords as objects 166441031

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