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

Closed
opened 2026-03-27 14:22:39 +00:00 by AI-Manager · 1 comment
Owner

Problem

Patent.patent_id is typed as int in types.py but treated as a str everywhere else in the codebase (e.g., file paths like patents/{patent_id}.pdf, URL parameters). This causes incorrect type checker warnings and potential runtime bugs if the field is ever coerced to int.

Work

  • Change the type annotation of Patent.patent_id from int to str in types.py.
  • Run mypy or pyright (or ruff check) to verify no downstream breakage.
  • Update any test fixtures or factory functions that construct Patent objects with integer IDs.

Acceptance Criteria

  • Patent.patent_id: str in types.py.
  • No type errors introduced by the change (run mypy or equivalent).
  • Existing tests still pass.

Reference

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

## Problem `Patent.patent_id` is typed as `int` in `types.py` but treated as a `str` everywhere else in the codebase (e.g., file paths like `patents/{patent_id}.pdf`, URL parameters). This causes incorrect type checker warnings and potential runtime bugs if the field is ever coerced to int. ## Work - Change the type annotation of `Patent.patent_id` from `int` to `str` in `types.py`. - Run `mypy` or `pyright` (or `ruff check`) to verify no downstream breakage. - Update any test fixtures or factory functions that construct `Patent` objects with integer IDs. ## Acceptance Criteria - `Patent.patent_id: str` in `types.py`. - No type errors introduced by the change (run `mypy` or equivalent). - Existing tests still pass. ## Reference Roadmap item: 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-27 14:22:39 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-27 15:02:46 +00:00
Author
Owner

[Repo Manager] This issue is resolved. types.py already declares patent_id: str (not int).

[Repo Manager] This issue is resolved. types.py already declares patent_id: str (not int).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#342