forked from 0xWheatyz/SPARC
Fix Patent.patent_id type annotation from int to str in types.py #623
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?
Context
Patent.patent_idis declared asintintypes.pybut is used as astreverywhere 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_idtyped asintbut used asstrWhat to do
patent_idfield type intypes.py(and any related Pydantic models) frominttostr.mypyorpyrightto confirm no new type errors are introduced.TEXTorVARCHAR, no migration required; if it isINTEGER, a migration is needed).Acceptance criteria
Patent.patent_idis typed asstrintypes.py.mypy(orpyright) reports no type error related topatent_id.Closing: already implemented on main.
types.pydeclarespatent_id: str(line 7).