Skip to content

spatialdata.write fails on Xenium sdata in env with pandas 3.0.0 #364

@EmielGeeraerts

Description

@EmielGeeraerts

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions