home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where author_association = "MEMBER" and issue = 894125618 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 3

  • shoyer 2
  • alexamici 1
  • mathause 1

issue 1

  • xarray 0.18.0 raises ValueError, not FileNotFoundError, when opening a non-existent file · 4 ✖

author_association 1

  • MEMBER · 4 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
843824599 https://github.com/pydata/xarray/issues/5329#issuecomment-843824599 https://api.github.com/repos/pydata/xarray/issues/5329 MDEyOklzc3VlQ29tbWVudDg0MzgyNDU5OQ== alexamici 226037 2021-05-19T07:28:03Z 2021-05-19T07:28:03Z MEMBER

@shoyer and @pont-us my take is that engine=None is mostly and feature to help new users experiment with xarray. The logic for autodetecting the engine has always been extremely fragile and the result depends on what packages are installed on the system.

I think it is OK to add a dedicated xarray.EngineGuessingError, but I'd not try anything more complex and in general invite users to pass engine explicitly.

Examples of strings that identify a dataset when the right backend is installed, but are not paths and the FileNotFoundError would sound confusing: - /vsizip/my.zip/my.tif with rioxarray - https://myhost/myfile.nc with netcdf4 and others

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xarray 0.18.0 raises ValueError, not FileNotFoundError, when opening a non-existent file 894125618
843757305 https://github.com/pydata/xarray/issues/5329#issuecomment-843757305 https://api.github.com/repos/pydata/xarray/issues/5329 MDEyOklzc3VlQ29tbWVudDg0Mzc1NzMwNQ== shoyer 1217238 2021-05-19T05:28:04Z 2021-05-19T05:28:04Z MEMBER

Actually, thinking about this a little more, you should get NoMatchingEngineError if you try to open a text file with Xarray.

But if you pass in a local filesystem path and try to open an entirely non-existent file, then FileNotFoundError would be appropriate.

In theory, one could write an open_dataset backend that interprets a local path in an arbitrary way, but that is not the intent of open_dataset, which is intended to handle things like files/directories, other URIs and file contents. If you want to interpret strings very differently you should write a new function for opening.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xarray 0.18.0 raises ValueError, not FileNotFoundError, when opening a non-existent file 894125618
843752655 https://github.com/pydata/xarray/issues/5329#issuecomment-843752655 https://api.github.com/repos/pydata/xarray/issues/5329 MDEyOklzc3VlQ29tbWVudDg0Mzc1MjY1NQ== shoyer 1217238 2021-05-19T05:15:39Z 2021-05-19T05:15:39Z MEMBER

Ouch! I agree this is annoying. And yes, the open_dataset docs definitely need updating.

The general rule is that ValueError is too generic of an exception for it to be appropriate to catch in user code. So indeed, if you need to catch that error something has gone wrong :).

Given this use case, perhaps we should have a special exception type here, something like xarray.NoMatchingEngineError.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xarray 0.18.0 raises ValueError, not FileNotFoundError, when opening a non-existent file 894125618
843032959 https://github.com/pydata/xarray/issues/5329#issuecomment-843032959 https://api.github.com/repos/pydata/xarray/issues/5329 MDEyOklzc3VlQ29tbWVudDg0MzAzMjk1OQ== mathause 10194086 2021-05-18T09:59:51Z 2021-05-18T09:59:51Z MEMBER

Thanks for the report - I added that to the list of todos for the 0.18.1 patch release.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xarray 0.18.0 raises ValueError, not FileNotFoundError, when opening a non-existent file 894125618

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