home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where author_association = "NONE" and user = 49512274 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

issue 2

  • uint32 variable in zarr, but float64 when loading with xarray 1
  • Keep attributes across operations 1

user 1

  • ludwigVonKoopa · 2 ✖

author_association 1

  • NONE · 2 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
822300379 https://github.com/pydata/xarray/issues/4311#issuecomment-822300379 https://api.github.com/repos/pydata/xarray/issues/4311 MDEyOklzc3VlQ29tbWVudDgyMjMwMDM3OQ== ludwigVonKoopa 49512274 2021-04-19T08:59:27Z 2021-04-19T08:59:27Z NONE

Problem found.

Another example with more minimalistic code :

```python zname = '/tmp/test.zarr' zh = zarr.open(zname, "w")

data = np.ones(10, dtype=np.uint32) za = zh.array("example", data) za.attrs["_ARRAY_DIMENSIONS"] = ["obs"] # or won't be read by xarray

print("zarr : ", za.dtype, za[:])

ds = xr.open_zarr(zname) print("xarray : ", ds.example.dtype, ds.example.values) python

zarr : uint32 [1 1 1 1 1 1 1 1 1 1] xarray : float64 [1. 1. 1. 1. 1. 1. 1. 1. 1. 1.] ```

After investigations, i found that you have to explicitly pass fill_value=None :

```python zname = '/tmp/test.zarr' zh = zarr.open(zname, "w")

data = np.ones(10, dtype=np.uint32) za = zh.array("example", data, fill_value=None) # <-- default fill_value=0

za.attrs["_ARRAY_DIMENSIONS"] = ["obs"] print("zarr : ", za.dtype, za[:])

ds = xr.open_zarr(zname) print("xarray : ", ds.example.dtype, ds.example.values) python

zarr : uint32 [1 1 1 1 1 1 1 1 1 1] xarray : uint32 [1 1 1 1 1 1 1 1 1 1] ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  uint32 variable in zarr, but float64 when loading with xarray 673504545
754088719 https://github.com/pydata/xarray/issues/4763#issuecomment-754088719 https://api.github.com/repos/pydata/xarray/issues/4763 MDEyOklzc3VlQ29tbWVudDc1NDA4ODcxOQ== ludwigVonKoopa 49512274 2021-01-04T16:52:15Z 2021-01-04T16:52:15Z NONE

ok I missread the documentation. Adding

xr.set_options(keep_attrs=True)

copy attributes correctly.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Keep attributes across operations 778221436

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