scverse / scverse/spatialdata-io
spatialdata.write fails on Xenium sdata in env with pandas 3.0.0
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 103
- Forks
- 65
- Avg merge
- 1h 8m
- Merged PRs (30d)
- 3
Description
I had some headaches trying to write a Xenium dataset as spatialdata object using write.
Error message:
anndata._io.specs.registry.IORegistryError: No method registered for writing <class 'pandas.arrays.ArrowStringArray'> into <class 'zarr.core.group.Group'>
Error raised while writing key '_index' of <class 'zarr.core.group.Group'> to /tables/table/obs
Turns out, with pandas 3.0.0 the default string type changed and a new writer is missing.
Resetting to pandas to "old behavior" did fix things for me, but just letting you know.
import pandas as pd
pd.options.mode.string_storage = "python"
import anndata as ad
ad.settings.allow_write_nullable_strings = True
I'm on spatialdata-io==0.5.1 and anndata==0.12.6 at the time of writing
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Xenium sdata write with pandas 3.0.0 and trace the missing writer for pandas.arrays.ArrowStringArray reported while writing table/obs/_index. Done means the dataset writes successfully with the default pandas 3.0.0 string type, without requiring the documented compatibility settings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- pandas, python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100