home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 1558347743

This data as json

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
1558347743 I_kwDOAMm_X85c4n_f 7478 Refresh list of backends (engines)? 703554 closed 0     1 2023-01-26T15:41:24Z 2023-03-31T15:14:58Z 2023-03-31T15:14:58Z CONTRIBUTOR      

What is your issue?

If a user is working in an environment where zarr is not initially installed (e.g., colab), then imports xarray, the list of available backends (engines) will not include zarr, as expected.

If the user subsequently installs zarr, then tries to open a zarr dataset via open_zarr() without restarting their kernel, they will get an error like:

ValueError: unrecognized engine zarr must be one of: ['netcdf4', 'scipy', 'store']

This can also be triggered in a more subtle way, because importing other packages like pandas will also trigger xarray to inspect and then fix this list of available engines.

Obviously this can be resolved by instructing users to restart their kernel after any install commands, or by telling them to always run install commands before any imports.

But I was wondering if there is a way to tell xarray to refresh its information about available engines?

I have been able to hack it by running:

xarray.backends.zarr.ZarrBackendEntrypoint.available = module_available("zarr") xarray.backends.list_engines.cache_clear()

...but maybe there is a better way?

Thanks :heart:

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

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.548ms · About: xarray-datasette