scverse / scverse/spatialdata

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

Open Beginner friendly
#1,172 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

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.

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

Start at the spatialdata.read_zarr() entry point and inspect how the selection argument is handled. Validate entries against images, labels, points, shapes, and tables, and confirm that an unknown value such as "table" raises a clear ValueError instead of silently omitting data.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.