claude-memory/graph/workflows/pr-review-paper-dynasty-database52-consolidate-double-query-c9b2c0.md

1.6 KiB

id type title tags importance confidence created updated relations
c9b2c04d-258a-4028-849b-a47f6168a6ab workflow PR review: paper-dynasty-database#52 — consolidate double-query in get_one_play
pr-reviewer
paper-dynasty-database
peewee
query-optimization
fastapi
0.4 0.8 2026-03-04T03:18:19.838537+00:00 2026-03-04T03:18:20.339054+00:00
target type direction strength edge_id
04e57a23-0a20-49d6-8c5a-2fa5fc4e55b5 RELATED_TO outgoing 0.79 74dd0ac6-e39b-4fad-a669-8603c077c366
target type direction strength edge_id
d36a86f0-8183-4c94-8d63-0be65d3fd63a RELATED_TO outgoing 0.78 ce383453-a3ad-4713-99bb-64a5ba980679
target type direction strength edge_id
5ae1bf6e-1e1c-4486-8a4d-10afd9e42189 RELATED_TO outgoing 0.78 ec1d17f5-18bf-4be4-8547-ad124b4debd3

PR #52 — fix: consolidate redundant double-query in get_one_play

Verdict: APPROVED (posted as COMMENT due to Gitea self-review restriction) File: app/routers_v2/stratplays.py

Change Summary

get_one_play was calling get_or_none (discarding the result) then get_by_id to fetch the same record again. Fix stores the get_or_none result and passes it directly to model_to_dict, eliminating the redundant second query.

Key Findings

  • Correct: get_or_none returns the model instance or None — reusing it is semantically identical
  • No security issues — unauthenticated GET, int-typed param
  • Clean, minimal change following project conventions

Follow-up Note

patch_play at ~line 1412 has the same double-query pattern and should be fixed in a follow-up issue.