home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

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

  • tovogt 1
  • krihabu 1

author_association 2

  • CONTRIBUTOR 1
  • NONE 1

issue 1

  • netCDF4: support byte strings as attribute values · 2 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1288870924 https://github.com/pydata/xarray/issues/7186#issuecomment-1288870924 https://api.github.com/repos/pydata/xarray/issues/7186 IC_kwDOAMm_X85M0pwM krihabu 64479100 2022-10-24T11:08:19Z 2022-10-24T11:08:19Z NONE

Thank you @tovogt! The workaround fits my needs for now.

Nevertheless, I would leave this issue open as a note for @tovogt 's suggestion to add bytes as a supported type for attributes.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  netCDF4: support byte strings as attribute values 1414669747
1287864880 https://github.com/pydata/xarray/issues/7186#issuecomment-1287864880 https://api.github.com/repos/pydata/xarray/issues/7186 IC_kwDOAMm_X85Mw0Iw tovogt 57705593 2022-10-22T17:37:05Z 2022-10-22T17:37:41Z CONTRIBUTOR

The reason for this behavior is that the netcdf4 python package automatically determines the type of the attribute (NC_CHAR or NC_STRING) by attempting the conversion to ASCII: https://github.com/Unidata/netcdf4-python/issues/529 However, if the value is a byte string, no conversion is done. So, the easiest solution would be to manually encode as utf-8 and then passing the byte string to netcdf4. Unfortunately, xarray doesn't support byte strings as attribute values even though this is a valid data type for the netcdf4 engine: https://github.com/pydata/xarray/blob/6cb97f645475bddf2f3b1e1a5f24f0f9de690683/xarray/backends/api.py#L175 In the long term, I would suggest to add bytes as a supported type in that list above on xarray's side.

A quick workaround for you might be to encode the string as utf-8 and convert to a numpy array, since xarray accepts numpy arrays as data type and netcdf4 automatically extracts the data if the array contains only a single item: python ds["x"].attrs["third_str"] = np.array("hää".encode("utf-8"))

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 1,
    "rocket": 0,
    "eyes": 0
}
  netCDF4: support byte strings as attribute values 1414669747

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