fix: replace deprecated Pydantic .dict() with .model_dump() (#76) #90

Open
Claude wants to merge 1 commits from issue/76-replace-deprecated-pydantic-dict-with-model-dump into main
Collaborator

Closes #76

Summary

Replaced all 21 occurrences of the deprecated Pydantic v2 .dict() method with .model_dump() across 17 router files.

Files Changed

  • app/routers_v3/awards.py
  • app/routers_v3/battingstats.py (2 occurrences)
  • app/routers_v3/current.py
  • app/routers_v3/decisions.py
  • app/routers_v3/divisions.py
  • app/routers_v3/draftlist.py
  • app/routers_v3/draftpicks.py (2 occurrences)
  • app/routers_v3/injuries.py
  • app/routers_v3/keepers.py
  • app/routers_v3/managers.py
  • app/routers_v3/pitchingstats.py (2 occurrences)
  • app/routers_v3/results.py
  • app/routers_v3/sbaplayers.py
  • app/routers_v3/schedules.py
  • app/routers_v3/stratgame.py
  • app/routers_v3/transactions.py
  • app/routers_v3/stratplay/crud.py (2 occurrences)

Notes

sbaplayers.py line 209 was already updated prior to this PR (noted in the issue). All remaining occurrences are now fixed. No logic changes — .model_dump() is a direct drop-in replacement for .dict() in Pydantic v2.

Closes #76 ## Summary Replaced all 21 occurrences of the deprecated Pydantic v2 `.dict()` method with `.model_dump()` across 17 router files. ## Files Changed - `app/routers_v3/awards.py` - `app/routers_v3/battingstats.py` (2 occurrences) - `app/routers_v3/current.py` - `app/routers_v3/decisions.py` - `app/routers_v3/divisions.py` - `app/routers_v3/draftlist.py` - `app/routers_v3/draftpicks.py` (2 occurrences) - `app/routers_v3/injuries.py` - `app/routers_v3/keepers.py` - `app/routers_v3/managers.py` - `app/routers_v3/pitchingstats.py` (2 occurrences) - `app/routers_v3/results.py` - `app/routers_v3/sbaplayers.py` - `app/routers_v3/schedules.py` - `app/routers_v3/stratgame.py` - `app/routers_v3/transactions.py` - `app/routers_v3/stratplay/crud.py` (2 occurrences) ## Notes `sbaplayers.py` line 209 was already updated prior to this PR (noted in the issue). All remaining occurrences are now fixed. No logic changes — `.model_dump()` is a direct drop-in replacement for `.dict()` in Pydantic v2.
Claude added 1 commit 2026-03-27 07:03:15 +00:00
fix: replace deprecated Pydantic .dict() with .model_dump() (#76)
All checks were successful
Build Docker Image / build (pull_request) Successful in 2m26s
75a8fc8505
Closes #76

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude added the
ai-reviewing
label 2026-03-27 07:15:53 +00:00
Claude reviewed 2026-03-27 07:17:05 +00:00
Claude left a comment
Author
Collaborator

AI Code Review

Files Reviewed

  • app/routers_v3/awards.py (modified)
  • app/routers_v3/battingstats.py (modified)
  • app/routers_v3/current.py (modified)
  • app/routers_v3/decisions.py (modified)
  • app/routers_v3/divisions.py (modified)
  • app/routers_v3/draftlist.py (modified)
  • app/routers_v3/draftpicks.py (modified)
  • app/routers_v3/injuries.py (modified)
  • app/routers_v3/keepers.py (modified)
  • app/routers_v3/managers.py (modified)
  • app/routers_v3/pitchingstats.py (modified)
  • app/routers_v3/results.py (modified)
  • app/routers_v3/sbaplayers.py (modified)
  • app/routers_v3/schedules.py (modified)
  • app/routers_v3/stratgame.py (modified)
  • app/routers_v3/transactions.py (modified)
  • app/routers_v3/stratplay/crud.py (modified)

Findings

Correctness

  • All 21 occurrences of .dict() replaced with .model_dump() — confirmed via grep on the full codebase (not just changed hunks).
  • Completeness verified: a repo-wide grep for .dict() matches exactly the 17 files modified in this PR, with zero stragglers in services, tests, or other directories.
  • .model_dump() is a direct, behaviorally-identical replacement for .dict() in Pydantic v2. All three usage patterns (unpacking into ORM constructor **model.model_dump(), appending to list for bulk insert, ORM .update(**model.model_dump())) are correct.
  • The two line-length reformats in battingstats.py and pitchingstats.py (splitting the .update(**...).where(...).execute() chain across lines) are correct and don't affect behavior.

Security

  • No issues. Pure method rename — no change to data flow, auth, or query construction.

Style & Conventions

  • No issues. Follows existing patterns throughout the router files.

Suggestions

  • None. This is as clean as a mechanical migration gets.

Verdict: APPROVED

Complete, correct, and fully-scoped Pydantic v2 migration. All 21 deprecated .dict() calls replaced with .model_dump() across all 17 affected files, with nothing missed. No logic changes, no regressions.


Automated review by Claude PR Reviewer (posted as COMMENT — Gitea blocks self-approval)

## AI Code Review ### Files Reviewed - `app/routers_v3/awards.py` (modified) - `app/routers_v3/battingstats.py` (modified) - `app/routers_v3/current.py` (modified) - `app/routers_v3/decisions.py` (modified) - `app/routers_v3/divisions.py` (modified) - `app/routers_v3/draftlist.py` (modified) - `app/routers_v3/draftpicks.py` (modified) - `app/routers_v3/injuries.py` (modified) - `app/routers_v3/keepers.py` (modified) - `app/routers_v3/managers.py` (modified) - `app/routers_v3/pitchingstats.py` (modified) - `app/routers_v3/results.py` (modified) - `app/routers_v3/sbaplayers.py` (modified) - `app/routers_v3/schedules.py` (modified) - `app/routers_v3/stratgame.py` (modified) - `app/routers_v3/transactions.py` (modified) - `app/routers_v3/stratplay/crud.py` (modified) ### Findings #### Correctness - All 21 occurrences of `.dict()` replaced with `.model_dump()` — confirmed via grep on the full codebase (not just changed hunks). - Completeness verified: a repo-wide grep for `.dict()` matches exactly the 17 files modified in this PR, with zero stragglers in services, tests, or other directories. - `.model_dump()` is a direct, behaviorally-identical replacement for `.dict()` in Pydantic v2. All three usage patterns (unpacking into ORM constructor `**model.model_dump()`, appending to list for bulk insert, ORM `.update(**model.model_dump())`) are correct. - The two line-length reformats in `battingstats.py` and `pitchingstats.py` (splitting the `.update(**...).where(...).execute()` chain across lines) are correct and don't affect behavior. #### Security - No issues. Pure method rename — no change to data flow, auth, or query construction. #### Style & Conventions - No issues. Follows existing patterns throughout the router files. #### Suggestions - None. This is as clean as a mechanical migration gets. ### Verdict: APPROVED Complete, correct, and fully-scoped Pydantic v2 migration. All 21 deprecated `.dict()` calls replaced with `.model_dump()` across all 17 affected files, with nothing missed. No logic changes, no regressions. --- *Automated review by Claude PR Reviewer (posted as COMMENT — Gitea blocks self-approval)*
Claude added the
ai-reviewed
label 2026-03-27 07:17:32 +00:00
All checks were successful
Build Docker Image / build (pull_request) Successful in 2m26s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue/76-replace-deprecated-pydantic-dict-with-model-dump:issue/76-replace-deprecated-pydantic-dict-with-model-dump
git checkout issue/76-replace-deprecated-pydantic-dict-with-model-dump
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/major-domo-database#90
No description provided.