home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 784484810 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 4

  • kmuehlbauer 2
  • mikapfl 2
  • dcherian 1
  • mathause 1

author_association 2

  • MEMBER 4
  • NONE 2

issue 1

  • attributes that are lists of strings with a single member don't survive a round-trip · 6 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
759484919 https://github.com/pydata/xarray/issues/4798#issuecomment-759484919 https://api.github.com/repos/pydata/xarray/issues/4798 MDEyOklzc3VlQ29tbWVudDc1OTQ4NDkxOQ== dcherian 2448579 2021-01-13T14:29:30Z 2021-01-13T14:29:30Z MEMBER

Could add a note to the docstring...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  attributes that are lists of strings with a single member don't survive a round-trip 784484810
759463781 https://github.com/pydata/xarray/issues/4798#issuecomment-759463781 https://api.github.com/repos/pydata/xarray/issues/4798 MDEyOklzc3VlQ29tbWVudDc1OTQ2Mzc4MQ== kmuehlbauer 5821660 2021-01-13T13:55:37Z 2021-01-13T13:55:37Z MEMBER

@mikapfl This was added with https://github.com/Unidata/netcdf4-python/pull/597. But I can't say anything profound why the single element is extracted from the list.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  attributes that are lists of strings with a single member don't survive a round-trip 784484810
759456390 https://github.com/pydata/xarray/issues/4798#issuecomment-759456390 https://api.github.com/repos/pydata/xarray/issues/4798 MDEyOklzc3VlQ29tbWVudDc1OTQ1NjM5MA== mikapfl 7226087 2021-01-13T13:43:20Z 2021-01-13T13:43:20Z NONE

@kmuehlbauer thanks for finding that out!

Now I'm wondering if that should be documented or some other solution; certainly, for me it was surprising, but maybe also my expectations were just wrong.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  attributes that are lists of strings with a single member don't survive a round-trip 784484810
759435034 https://github.com/pydata/xarray/issues/4798#issuecomment-759435034 https://api.github.com/repos/pydata/xarray/issues/4798 MDEyOklzc3VlQ29tbWVudDc1OTQzNTAzNA== kmuehlbauer 5821660 2021-01-13T13:03:43Z 2021-01-13T13:04:49Z MEMBER

@mikapfl That's by design in netCDF4:

https://github.com/Unidata/netcdf4-python/blob/bcbe3a0c62e6aa012b7afe7c9b2cfc9b2abc5424/src/netCDF4/_netCDF4.pyx#L1478-L1482

python if len(result) == 1: return result[0] else: return result

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  attributes that are lists of strings with a single member don't survive a round-trip 784484810
759397199 https://github.com/pydata/xarray/issues/4798#issuecomment-759397199 https://api.github.com/repos/pydata/xarray/issues/4798 MDEyOklzc3VlQ29tbWVudDc1OTM5NzE5OQ== mikapfl 7226087 2021-01-13T11:47:39Z 2021-01-13T11:47:39Z NONE

Actually, this is a problem which is specific to the netcdf4 backend, using h5netcdf, this works: ```python import xarray as xr

ds = xr.Dataset(attrs={"foo": ["bar"]},)

ds.to_netcdf("ds.nc", engine="h5netcdf") rd = xr.open_dataset("ds.nc", engine="h5netcdf")

assert ds.attrs["foo"] == rd.attrs["foo"] ``` and runs without problems.

As soon as I involve netcdf4 in reading or writing, this fails.

I don't know enough about netcdf's on-disk format to really debug what is going on. The ncdump output looks identical to me for both engines.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  attributes that are lists of strings with a single member don't survive a round-trip 784484810
758990368 https://github.com/pydata/xarray/issues/4798#issuecomment-758990368 https://api.github.com/repos/pydata/xarray/issues/4798 MDEyOklzc3VlQ29tbWVudDc1ODk5MDM2OA== mathause 10194086 2021-01-12T21:05:19Z 2021-01-12T21:05:52Z MEMBER

There is an explicit condition for the size to be > 1

https://github.com/pydata/xarray/blob/f52a95cbe694336fe47bc5a42c713bee8ad74d64/xarray/backends/netCDF4_.py#L274-L275

However, even when setting the condition to > 0 it is saved as a string and not as a list of strings - maybe check if this can be achieved with netCDF4 at all.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  attributes that are lists of strings with a single member don't survive a round-trip 784484810

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