fix: remove unused PLAYER_CACHE variable from api_calls.py (#37) #64
No reviewers
Labels
No Label
ai-changes-requested
ai-failed
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
ai-working
bug
enhancement
feature
in-queue
performance
security
tech-debt
todo
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-discord#64
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ai/paper-dynasty-discord-37"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Removes the dead
PLAYER_CACHE = {}variable atapi_calls.py:21.What was wrong
PLAYER_CACHE = {}was defined at module level but never read or written anywhere inapi_calls.py. The actual player cache lives inin_game/data_cache.py:9and is actively used there. Theapi_calls.pycopy was misleading dead code.Changes
api_calls.py: Deleted line 21 (PLAYER_CACHE = {})Verification
grep -r PLAYER_CACHEconfirms no remaining references to the deleted variablein_game/data_cache.pyis the only file wherePLAYER_CACHEis functionally usedcogs/admins.py:578has a commented-out reference toin_game.data_cache.PLAYER_CACHE(the correct one) — unaffectedOther observations
master_debug = Trueon the adjacent line is a separate issue (#58) — not touched hereapi_calls.pyhas two unused imports (datetime,dataclass) per Pyright — pre-existing, out of scopeAI Code Review
Files Reviewed
api_calls.py(modified — 1 line deleted)Findings
Correctness
PLAYER_CACHE = {}at line 21 is accurate.grep -r PLAYER_CACHEconfirms zero live read/write references to this variable anywhere inapi_calls.py— the variable was defined but never used.in_game/data_cache.py:9holds the realPLAYER_CACHEand is the only location that reads/writes it (lines 266–282).cogs/admins.py:578has a commented-out reference toin_game.data_cache.PLAYER_CACHE— correctly scoped to the live cache, unaffected by this change.Security
Style & Conventions
Suggestions
master_debug(issue #58) and unused imports (datetime,dataclass) being out of scope are correct — those are separate concerns.Verdict: APPROVED
Single-line dead code removal. Grep verification is thorough, no live callers exist, and the real
PLAYER_CACHEinin_game/data_cache.pyis untouched.Automated review by Claude PR Reviewer
2a39139428to4d62458b3dClosing — will re-implement fresh against
main. Original PR had unrebaseable conflicts from the scouting refactor.Pull request closed