home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 1512290017 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 2

  • slevang 2
  • jhamman 1

author_association 2

  • CONTRIBUTOR 2
  • MEMBER 1

issue 1

  • Zarr error when trying to overwrite part of existing store · 3 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1379504132 https://github.com/pydata/xarray/issues/7403#issuecomment-1379504132 https://api.github.com/repos/pydata/xarray/issues/7403 IC_kwDOAMm_X85SOZAE slevang 39069044 2023-01-11T21:26:10Z 2023-01-11T21:26:10Z CONTRIBUTOR

Personally, I'll make the argument that we should switch (carefully) from -w to w for the default case.

This makes sense in principal for consistency with other i/o methods, but I think could go very wrong in practice, especially for inexperienced users.

For example, a misplaced command of ds.to_zarr("gs://bucket_name") with default mode="w" overwrites a user's entire bucket, and same thing for local storage. to_netcdf doesn't have the capability to rm -r a directory, so I would argue to_zarr(mode="w") is much more dangerous.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Zarr error when trying to overwrite part of existing store 1512290017
1371540921 https://github.com/pydata/xarray/issues/7403#issuecomment-1371540921 https://api.github.com/repos/pydata/xarray/issues/7403 IC_kwDOAMm_X85RwA25 jhamman 2443309 2023-01-04T23:24:46Z 2023-01-04T23:24:46Z MEMBER

I think the above example can be reduced to just:

python ds = xr.Dataset() ds.to_zarr('test.zarr') ds.to_zarr('test.zarr')

An interesting data point here is that to_netcdf defaults to w mode. And this works fine:

python ds = xr.Dataset() ds.to_netcdf('test.nc') ds.to_netcdf('test.nc')

Personally, I'll make the argument that we should switch (carefully) from -w to w for the default case.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Zarr error when trying to overwrite part of existing store 1512290017
1366882900 https://github.com/pydata/xarray/issues/7403#issuecomment-1366882900 https://api.github.com/repos/pydata/xarray/issues/7403 IC_kwDOAMm_X85RePpU slevang 39069044 2022-12-28T19:53:05Z 2022-12-28T19:53:05Z CONTRIBUTOR

Your MCVE has mode="a", is that intentional? As far as defaults, what the docstring says is:

The default mode is “a” if append_dim is set. Otherwise, it is “r+” if region is set and w- otherwise.

So without specifying mode, you get mode="w-" which will not overwrite anything. With mode="a", your MCVE runs fine for me.

From using these a bit, my understanding is:

  • mode="w-" is the safe default that won't overwrite anything
  • mode="w" is only if you want to rewrite the entire zarr store, not for rewriting a subset of existing data
  • mode="r+" is for modifying values on some subset of the existing store specified by the index with region, but doesn't allow changing any dimension sizes
  • mode="a" is for completely overwriting existing variables*, appending new variables, or appending data along an existing dimension, paired with append_dim

* I actually didn't realize this behavior until testing it out just now, but it is described in the docstring

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 1
}
  Zarr error when trying to overwrite part of existing store 1512290017

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