forked from 0xWheatyz/SPARC
Fix Patent.patent_id type annotation from int to str in types.py #1054
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
Roadmap reference: ROADMAP.md > P2 > Backend > Patent.patent_id typed as int but used as str
Patent.patent_idis declared asintintypes.pybut the rest of the codebase treats it as astr(e.g., constructingpatents/{patent_id}.pdf, passing it to SERP API calls). This type mismatch causesmypy/pyrighterrors and can lead to subtle runtime bugs such as incorrect string formatting or JSON serialization.What to do
patent_idfield type annotation intypes.pyfrominttostr.int()conversions or numeric operations onpatent_idand fix them.mypy(orpyright) and ensure no new type errors are introduced by the change.Acceptance criteria
Patent.patent_idis annotated asstrintypes.py.mypy --strict(or equivalent) passes without errors related topatent_id.Triage by @AI-Manager
Closing: already implemented in main.
types.pydeclaresPatent.patent_idasstr.