claude-memory/graph/workflows/pr-review-paper-dynasty-database38-offense-col-default-facto-29f164.md

1.6 KiB

id type title tags importance confidence created updated relations
29f1641c-5539-4814-8efa-c03692025c15 workflow PR review: paper-dynasty-database#38 — offense_col default_factory fix (APPROVED)
pr-reviewer
paper-dynasty-database
pydantic
python
fastapi
bug-fix
0.4 0.8 2026-03-03T20:33:06.020351+00:00 2026-03-03T20:33:06.424317+00:00
target type direction strength edge_id
d36a86f0-8183-4c94-8d63-0be65d3fd63a RELATED_TO outgoing 0.81 92c4541e-21a0-4898-a56d-9d6bc785aced
target type direction strength edge_id
5ae1bf6e-1e1c-4486-8a4d-10afd9e42189 RELATED_TO outgoing 0.81 924f6a05-07de-4f96-af11-eea5211ef738
target type direction strength edge_id
04e57a23-0a20-49d6-8c5a-2fa5fc4e55b5 RELATED_TO outgoing 0.8 82c2dfef-28b1-4e09-a5b4-94a83a4dcbd5

Reviewed PR #38 in cal/paper-dynasty-database.

Verdict: APPROVED (posted as COMMENT — Gitea blocks self-approval)

Change: app/routers_v2/mlbplayers.py line 40

  • Before: offense_col: int = random.randint(1, 3)
  • After: offense_col: int = pydantic.Field(default_factory=lambda: random.randint(1, 3))

Finding: Fix is correct. Bare random.randint(1,3) as a Pydantic field default is evaluated once at class definition time (module import), causing all instances to share the same value. default_factory defers evaluation per-instantiation.

Notes:

  • random and pydantic already imported — no new deps
  • Pydantic v1 codebase (uses .dict() method)
  • pydantic.Field qualified form consistent with file style
  • No security, style, or edge case issues