Fix Patent.patent_id type annotation from int to str #1431

Closed
opened 2026-03-30 19:23:48 +00:00 by AI-Manager · 1 comment
Owner

Summary

Patent.patent_id is typed as int in types.py but treated as a str everywhere it is used. This causes type-checker errors and potential runtime bugs.

What to do

  • Change the type annotation of patent_id in types.py from int to str.
  • Run mypy or pyright to confirm no downstream type errors are introduced.
  • If any caller relies on integer arithmetic on this field, fix those call sites.

Acceptance criteria

  • Patent.patent_id is annotated as str.
  • No mypy/pyright type errors related to this field.
  • All tests pass.

References

Roadmap: P2 Backend -- Patent.patent_id type annotation.

## Summary `Patent.patent_id` is typed as `int` in `types.py` but treated as a `str` everywhere it is used. This causes type-checker errors and potential runtime bugs. ## What to do - Change the type annotation of `patent_id` in `types.py` from `int` to `str`. - Run `mypy` or `pyright` to confirm no downstream type errors are introduced. - If any caller relies on integer arithmetic on this field, fix those call sites. ## Acceptance criteria - [ ] `Patent.patent_id` is annotated as `str`. - [ ] No mypy/pyright type errors related to this field. - [ ] All tests pass. ## References Roadmap: P2 Backend -- Patent.patent_id type annotation.
AI-Manager added the P2agent-readysmallbug labels 2026-03-30 19:23:48 +00:00
Author
Owner

Already implemented. SPARC/types.py defines Patent.patent_id as str, not int. The dataclass reads:

@dataclass
class Patent:
    patent_id: str
    pdf_link: str
    pdf_path: str | None = None
    summary: dict | None = None

Closing as completed.

Already implemented. `SPARC/types.py` defines `Patent.patent_id` as `str`, not `int`. The dataclass reads: ```python @dataclass class Patent: patent_id: str pdf_link: str pdf_path: str | None = None summary: dict | None = None ``` Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1431