forked from 0xWheatyz/SPARC
Fix Patent.patent_id type annotation from int to str in types.py #861
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
Roadmap item: P2 - Backend - Patent.patent_id typed as int but used as str
Patent.patent_idis annotated asintintypes.pybut is treated as astreverywhere it is used in the codebase. This causes type-checker warnings and potential runtime bugs when integer operations are attempted on a string value.Work to do
patent_idfield type annotation intypes.pyfrominttostr.mypyorpyrightto surface any downstream type errors introduced by the change.mypyorrufftype-checking to the CI pipeline (or note it as a follow-up if CI changes are out of scope).Acceptance criteria
Patent.patent_idis annotated asstrintypes.py.patent_id.Resolved in codebase. SPARC/types.py line 7: patent_id is typed as str in the Patent dataclass. Closing as implemented.