scverse / scverse/spatialdata

Replace some `AssertionError` with other exceptions

Open
#483 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
394
Forks
95
Avg merge
4d 3h
Merged PRs (30d)
7

Description

As @jeffquinn-msk observed, assertions are ignored when the code runs in production. We should verify that no assertion is actually required for the logic of the execution, and in case they are required, replace them with other types of exception. Many assertions are used for mypy, but I see some of them are required for a correct execution, so better to look for them and replace them.

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

Search the Python codebase for assertions and determine which are required for correct execution rather than used only for mypy. Replace required assertions with other exception types, while leaving type-checking-only assertions as appropriate; done means production execution does not depend on assertion checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.