Subcategory: Type safety (+ dependency hygiene)
Score: type safety 3 → ~6, dependency hygiene 9 → 10
Two of these are genuine latent bugs, not annotation noise. Fixing all three clears the 2 import-untyped, 2 valid-type, 1 index, 1 var-annotated and 2 assignment/attr-defined errors, plus most of the 11 cascading no-any-return errors that exist only because untyped pandas returns Any.
What to change
(a) src/pycharting/data/ingestion.py:20 — SubplotSpec = pd.Series | np.ndarray | list | dict[str, Any] is an implicit alias, which mypy rejects as a type. Use a PEP 695 alias — valid here since the project requires Python ≥ 3.12:
type SubplotSpec = pd.Series | np.ndarray | list | dict[str, Any]
This also clears the downstream index error at ingestion.py:190 and var-annotated at :192.
(b) src/pycharting/core/lifecycle.py:62 — self._server = None is unannotated, so mypy infers the attribute type as None, making :131 and :134 errors. Annotate:
self._server: uvicorn.Server | None = None
(c) Add pandas-stubs to a dependency group so import pandas is typed (ingestion.py:15, interface.py:23).
done when
mypy --strict reports no valid-type, import-untyped, assignment, attr-defined, index or var-annotated errors.
Evidence
src/pycharting/data/ingestion.py:34: error: Variable "pycharting.data.ingestion.SubplotSpec" is not valid as a type [valid-type]
src/pycharting/core/lifecycle.py:131: error: Incompatible types in assignment (expression has type "Server", variable has type "None") [assignment]
Surfaced by the Rhiza quality gates during the template bump to jebel-quant/rhiza@v1.2.2, which enabled the stricter ruff rule families (ANN, A, BLE, ARG) and TYPECHECKER=both. Gate status at time of filing: make fmt FAIL, make typecheck FAIL, make docs-coverage FAIL, test-layout FAIL; make deptry, make security, make test PASS (154 tests, 100% coverage).
Subcategory: Type safety (+ dependency hygiene)
Score: type safety 3 → ~6, dependency hygiene 9 → 10
Two of these are genuine latent bugs, not annotation noise. Fixing all three clears the 2
import-untyped, 2valid-type, 1index, 1var-annotatedand 2assignment/attr-definederrors, plus most of the 11 cascadingno-any-returnerrors that exist only because untyped pandas returnsAny.What to change
(a)
src/pycharting/data/ingestion.py:20—SubplotSpec = pd.Series | np.ndarray | list | dict[str, Any]is an implicit alias, which mypy rejects as a type. Use a PEP 695 alias — valid here since the project requires Python ≥ 3.12:This also clears the downstream
indexerror atingestion.py:190andvar-annotatedat:192.(b)
src/pycharting/core/lifecycle.py:62—self._server = Noneis unannotated, so mypy infers the attribute type asNone, making:131and:134errors. Annotate:(c) Add
pandas-stubsto a dependency group soimport pandasis typed (ingestion.py:15,interface.py:23).done when
mypy --strictreports novalid-type,import-untyped,assignment,attr-defined,indexorvar-annotatederrors.Evidence
Surfaced by the Rhiza quality gates during the template bump to
jebel-quant/rhiza@v1.2.2, which enabled the stricter ruff rule families (ANN, A, BLE, ARG) andTYPECHECKER=both. Gate status at time of filing:make fmtFAIL,make typecheckFAIL,make docs-coverageFAIL, test-layout FAIL;make deptry,make security,make testPASS (154 tests, 100% coverage).