Skip to content

Dask diagnostics import error #1052

@josenimo

Description

@josenimo

Dear spatialdata devs,

somehow i am running into this silly thing from a fresh install with demo dataset.

Reproduce using the mouse data liver .zarr demo dataset 01_test.ipynb

Describe the bug
sdata['raw_image'] runs into ImportError:

ImportError: Dask diagnostics requirements are not installed.

Please either conda or pip install as follows:

  conda install dask                     # either conda install
  python -m pip install "dask[diagnostics]" --upgrade  # or python -m pip install

! uv pip install "dask[diagnostics]" --upgrade and restarting kernel leads to:

---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 import spatialdata as sd

File ~/Jose_BI/2_Infrastructure/PY08_SpatialData/.venv/lib/python3.13/site-packages/spatialdata/__init__.py:4
      1 import dask
      3 dask.config.set({"dataframe.query-planning": False})
----> 4 import dask.dataframe as dd
      6 # Setting `dataframe.query-planning` to False is effective only if run before `dask.dataframe` is initialized. In
      7 # the case in which the user had initilized `dask.dataframe` before, we would have DASK_EXPER_ENABLED set to `True`.
      8 # Here we check that this does not happen.
      9 if hasattr(dd, "DASK_EXPR_ENABLED") and dd.DASK_EXPR_ENABLED:

File ~/Jose_BI/2_Infrastructure/PY08_SpatialData/.venv/lib/python3.13/site-packages/dask/dataframe/__init__.py:14
      9         raise NotImplementedError("The legacy implementation is no longer supported")
     11     return True
---> 14 _dask_expr_enabled()
     17 import dask.array._array_expr._backends  # Import this to register array dispatch
     19 # Ensure that dtypes are registered

File ~/Jose_BI/2_Infrastructure/PY08_SpatialData/.venv/lib/python3.13/site-packages/dask/dataframe/__init__.py:9, in _dask_expr_enabled()
      7 use_dask_expr = dask.config.get("dataframe.query-planning")
      8 if use_dask_expr is False:
----> 9     raise NotImplementedError("The legacy implementation is no longer supported")
     11 return True

NotImplementedError: The legacy implementation is no longer supported

To Reproduce

  1. fresh spatialdata install
  2. load .zarr demo data
  3. inspect raw_image

Expected behavior
normal inspection of raw image element

Screenshots
see notebook

Desktop (optional):

  • OS: macOS
  • Version 15.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions