forked from 0xWheatyz/SPARC
Fix Patent.patent_id type annotation from int to str in types.py #1386
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 item: P2 Backend — Patent.patent_id typed as int but used as str
types.pydeclarespatent_id: intbut every usage across the codebase treats it as a string (e.g. constructing file paths likepatents/{patent_id}.pdf, using it as a dict key, etc.). This type mismatch causes mypy/pyright errors and can cause subtle runtime bugs when the id is used in arithmetic context.Task
patent_idfield annotation intypes.py(and any Pydantic model or dataclass) frominttostr.patent_id.mypyorpyrightto confirm no remaining type errors for this field.Acceptance Criteria
Patent.patent_idis annotated asstrintypes.py.patent_idremain.Reference
See ROADMAP.md § P2 Backend.
Resolved by PR #29 (merged).
Patent.patent_idintypes.pyis correctly typed asstr(verified in current codebase).