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

Closed
opened 2026-03-26 08:23:07 +00:00 by AI-Manager · 1 comment
Owner

Problem

Patent.patent_id is annotated as int in types.py but is used as a str everywhere in the codebase (e.g., as a filename component patents/{patent_id}.pdf, as a query parameter, and in API responses). This inconsistency causes mypy/pyright type errors and can lead to subtle runtime bugs.

Task

  • Change the patent_id field annotation in types.py from int to str.
  • Run mypy (or pyright) to surface any cascading type errors and fix them.
  • Verify no code path casts patent_id to int when str is expected (or vice versa).
  • Ensure all existing tests pass after the change.

Acceptance Criteria

  • types.py annotates patent_id as str.
  • mypy backend/ reports no errors related to patent_id.
  • All tests pass.

References

Roadmap: P2 -- Backend -- Patent.patent_id typed as int in types.py but used as str everywhere.

## Problem `Patent.patent_id` is annotated as `int` in `types.py` but is used as a `str` everywhere in the codebase (e.g., as a filename component `patents/{patent_id}.pdf`, as a query parameter, and in API responses). This inconsistency causes mypy/pyright type errors and can lead to subtle runtime bugs. ## Task - Change the `patent_id` field annotation in `types.py` from `int` to `str`. - Run `mypy` (or `pyright`) to surface any cascading type errors and fix them. - Verify no code path casts `patent_id` to `int` when `str` is expected (or vice versa). - Ensure all existing tests pass after the change. ## Acceptance Criteria - `types.py` annotates `patent_id` as `str`. - `mypy backend/` reports no errors related to `patent_id`. - All tests pass. ## References Roadmap: P2 -- Backend -- Patent.patent_id typed as int in types.py but used as str everywhere.
AI-Manager added the P2agent-readysmall labels 2026-03-26 08:23:07 +00:00
Author
Owner

Closing: Already implemented in PR #29. types.py has patent_id typed as str.

Closing: Already implemented in PR #29. types.py has patent_id typed as str.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#49