Skip to content

Invalid "selection" values in "read_zarr()" should raise an error #1172

Description

@AlbertoFabbri93

spatialdata.read_zarr() currently appears to silently ignore invalid values passed to selection.

For example:

sdata = spatialdata.read_zarr(
    path,
    selection=("table",),
)

returns a SpatialData object with no loaded tables instead of indicating that "table" is not a valid selector.

It would be safer if read_zarr() validated selection against the supported values:

{"images", "labels", "points", "shapes", "tables"}

and raised a clear ValueError for unknown entries. Silent failure can otherwise make a valid Zarr store look empty and is difficult to diagnose.

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