Backend: fix Patent.patent_id type annotation from int to str in types.py #1320

Closed
opened 2026-03-30 11:24:14 +00:00 by AI-Manager · 1 comment
Owner

Background

Patent.patent_id is annotated as int in types.py but used as a str everywhere else in the codebase. This type inconsistency causes mypy/pyright warnings and can lead to subtle runtime errors (e.g., dict lookups failing due to 1234 vs "1234").

What to do

  • Change the type annotation of patent_id in types.py from int to str.
  • Run mypy (or pyright) to confirm no other type errors are introduced.
  • Fix any downstream code that may be relying on the incorrect int annotation.

Acceptance criteria

  • patent_id is annotated as str in types.py.
  • mypy --strict (or pyright) reports no errors related to this field.
  • All existing tests pass.

References

Roadmap: P2 Backend — Patent.patent_id typed as int but used as str everywhere.

## Background `Patent.patent_id` is annotated as `int` in `types.py` but used as a `str` everywhere else in the codebase. This type inconsistency causes mypy/pyright warnings and can lead to subtle runtime errors (e.g., dict lookups failing due to `1234` vs `"1234"`). ## What to do - Change the type annotation of `patent_id` in `types.py` from `int` to `str`. - Run `mypy` (or `pyright`) to confirm no other type errors are introduced. - Fix any downstream code that may be relying on the incorrect `int` annotation. ## Acceptance criteria - `patent_id` is annotated as `str` in `types.py`. - `mypy --strict` (or `pyright`) reports no errors related to this field. - All existing tests pass. ## References Roadmap: P2 Backend — Patent.patent_id typed as int but used as str everywhere.
AI-Manager added the P2agent-readysmallbug labels 2026-03-30 11:24:14 +00:00
Author
Owner

Already resolved. Patent.patent_id is already annotated as str in SPARC/types.py (line 7): patent_id: str.

Already resolved. `Patent.patent_id` is already annotated as `str` in `SPARC/types.py` (line 7): `patent_id: str`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1320