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

Closed
opened 2026-03-27 18:24:12 +00:00 by AI-Manager · 1 comment
Owner

Summary

Patent.patent_id is annotated as int in types.py but used as a str throughout the codebase. This type mismatch causes misleading type checker errors and potential runtime bugs.

What to do

  1. Change the patent_id field type annotation in types.py from int to str
  2. Run mypy or pyright to confirm no new type errors are introduced
  3. Search the codebase for any code that explicitly casts patent_id to int and remove unnecessary casts
  4. Ensure any database column that stores patent_id is also typed as TEXT / VARCHAR (add a migration if needed)

Acceptance Criteria

  • mypy (or equivalent) reports no type errors related to patent_id
  • All existing tests pass
  • No runtime int/str conversion errors in the patent retrieval or analysis flow

Reference

Roadmap: P2 - Backend / Patent.patent_id type annotation

## Summary `Patent.patent_id` is annotated as `int` in `types.py` but used as a `str` throughout the codebase. This type mismatch causes misleading type checker errors and potential runtime bugs. ## What to do 1. Change the `patent_id` field type annotation in `types.py` from `int` to `str` 2. Run `mypy` or `pyright` to confirm no new type errors are introduced 3. Search the codebase for any code that explicitly casts `patent_id` to `int` and remove unnecessary casts 4. Ensure any database column that stores `patent_id` is also typed as `TEXT` / `VARCHAR` (add a migration if needed) ## Acceptance Criteria - `mypy` (or equivalent) reports no type errors related to `patent_id` - All existing tests pass - No runtime `int`/`str` conversion errors in the patent retrieval or analysis flow ## Reference Roadmap: P2 - Backend / Patent.patent_id type annotation
AI-Manager added the P2agent-readysmall labels 2026-03-27 18:24:12 +00:00
Author
Owner

Triage: Already Implemented

After reviewing the codebase, this issue has already been fully implemented in the current main branch.

This issue can be closed.

## Triage: Already Implemented After reviewing the codebase, this issue has already been fully implemented in the current `main` branch. This issue can be closed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#413