1.6 KiB
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) |
|
0.4 | 0.8 | 2026-03-03T20:33:06.020351+00:00 | 2026-03-03T20:33:06.424317+00:00 |
|
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:
randomandpydanticalready imported — no new deps- Pydantic v1 codebase (uses
.dict()method) pydantic.Fieldqualified form consistent with file style- No security, style, or edge case issues