scverse / scverse/spatialdata

Unable to save SpatialData object to zarr

Open
#1,135 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs: triage priority: medium
Dominant language
Python
Stars
394
Forks
95
Avg merge
4d 3h
Merged PRs (30d)
7

Description

Hello,
Saving a spatialdata object to zarr file throws error.

Reproducible example with blobs() dataset:

from spatialdata.datasets import blobs
sdata_github = blobs()
sdata_github.write(path_zarr+"github_report_bug.zarr",overwrite=True)

Bug description:
It throws the error:

RuntimeError: `anndata.settings.allow_write_nullable_strings` is False, because writing of `pd.arrays.{StringArray,ArrowStringArray}` is new and not supported in anndata < 0.11, still use by many people. Opt-in to writing these arrays by toggling the setting to True.
Error raised while writing key '_index' of <class 'zarr.core.group.Group'> to /tables/table/obs

Session Info:

spatialdata_io version: 0.7.0
scanpy version: 1.11.2
pandas version: 3.0.2
numpy version: 2.3.5
anndata version: 0.12.16
spatialdata version: 0.7.3
spatialdata_plot version: 0.3.4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the reported blobs() example with the listed package versions and confirm the failure in the write(path_zarr+"github_report_bug.zarr", overwrite=True) path. Trace the write operation to the point where the error is raised for the _index key under /tables/table/obs. Done means the reproducible SpatialData object saves to zarr without this error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.