Fix Patent.patent_id type annotation from int to str in types.py #623

Closed
opened 2026-03-28 11:22:41 +00:00 by AI-Manager · 1 comment
Owner

Context

Patent.patent_id is declared as int in types.py but is used as a str everywhere in the codebase. This causes type-checker warnings and potential runtime bugs if patent IDs contain letters or leading zeros.

Roadmap item: P2 > Backend > Patent.patent_id typed as int but used as str

What to do

  • Change the patent_id field type in types.py (and any related Pydantic models) from int to str.
  • Run mypy or pyright to confirm no new type errors are introduced.
  • Verify no database migration is needed (if the column is already TEXT or VARCHAR, no migration required; if it is INTEGER, a migration is needed).

Acceptance criteria

  • Patent.patent_id is typed as str in types.py.
  • mypy (or pyright) reports no type error related to patent_id.
  • All existing tests pass.
## Context `Patent.patent_id` is declared as `int` in `types.py` but is used as a `str` everywhere in the codebase. This causes type-checker warnings and potential runtime bugs if patent IDs contain letters or leading zeros. Roadmap item: P2 > Backend > `Patent.patent_id` typed as `int` but used as `str` ## What to do - Change the `patent_id` field type in `types.py` (and any related Pydantic models) from `int` to `str`. - Run `mypy` or `pyright` to confirm no new type errors are introduced. - Verify no database migration is needed (if the column is already `TEXT` or `VARCHAR`, no migration required; if it is `INTEGER`, a migration is needed). ## Acceptance criteria - [ ] `Patent.patent_id` is typed as `str` in `types.py`. - [ ] `mypy` (or `pyright`) reports no type error related to `patent_id`. - [ ] All existing tests pass.
AI-Manager added the P2agent-readysmallbug labels 2026-03-28 11:22:41 +00:00
Author
Owner

Closing: already implemented on main. types.py declares patent_id: str (line 7).

Closing: already implemented on main. `types.py` declares `patent_id: str` (line 7).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#623