home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

2 rows where "closed_at" is on date 2020-09-28 and user = 226037 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

type 2

  • issue 1
  • pull 1

state 1

  • closed 2

repo 1

  • xarray 2
id node_id number title user state locked assignee milestone comments created_at updated_at ▲ closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
708766975 MDExOlB1bGxSZXF1ZXN0NDkyOTMxMzk3 4458 Autodetect the engine only when `engine=None` alexamici 226037 closed 0     2 2020-09-25T08:53:27Z 2020-12-10T10:30:56Z 2020-09-28T15:42:01Z MEMBER   0 pydata/xarray/pulls/4458

Always use the engine explicitly selected by the user and perform auto detection only when engine=None.

  • [x] Closes #4457
  • [x] Tests added
  • [x] Passes isort . && black . && mypy . && flake8
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [x] No new functions/methods

The refactor complexity stems mostly from moving or duplicating some logic from _get_engine_from_magic_number to the backend stores. The current, rather ugly, code minimizes changes to the error conditions and messages.

Later in the backend refactor the plugins will provide the functionalities to identify the format from the file content and the duplication should be eliminated.

@jhamman do you think I need to acknowledge the CZI sponsorship in the changelog?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4458/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
708459047 MDU6SXNzdWU3MDg0NTkwNDc= 4457 Silently ignoring user passed `engine` key in some cases when opening file objects alexamici 226037 closed 0     0 2020-09-24T20:37:37Z 2020-09-28T15:42:01Z 2020-09-28T15:42:01Z MEMBER      

What happened:

When I open() a netCDF4 file and pass the file object to xr.open_dataset with engine='scipy' xarray silently ignores the value of the engine keyword and opens the file with h5netcdf. When opening an netCDF3 file with engine='h5netcdf' the scipy engine is used instead without warning.

What you expected to happen:

Silent autodetection of the engine is fine when passing engine=None, but it is very surprising when passing a value explicitly. I would have expected an exception or at least a warning.

Minimal Complete Verifiable Example:

```python

xr.open_dataset('netCDF4.nc', engine='scipy')


KeyError Traceback (most recent call last) [...] TypeError: Error: netCDF4.nc is not a valid NetCDF 3 file If this is a NetCDF4 file, you may need to install the netcdf4 library, e.g.,

        $ pip install netcdf4

fp = open('netCDF4.nc') xr.open_dataset(fp, engine='scipy') <xarray.Dataset> Dimensions: (line: 41587, pixel: 17751) Coordinates: * line (line) int64 0 1 2 3 4 5 ... 41582 41583 41584 41585 41586 * pixel (pixel) int64 0 1 2 3 4 5 ... 17746 17747 17748 17749 17750 Data variables: phase (line, pixel) float32 ... Attributes: Conventions: CF-1.7 [...] ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4457/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 19.243ms · About: xarray-datasette