fix: remove duplicate sheets.open_by_key() call in get_full_roster_from_sheets (#30) #56

Merged
cal merged 1 commits from ai/paper-dynasty-discord-30 into next-release 2026-03-07 07:42:27 +00:00
Owner

Summary

Removes the duplicate sheets.open_by_key(this_team.gsheet) call on line 1161 of command_logic/logic_gameplay.py. The function called the Google Sheets API twice back-to-back with no logic between the calls, causing an unnecessary round-trip.

Changes

  • command_logic/logic_gameplay.py: removed redundant second sheets.open_by_key() call

Other observations

The commit also includes pre-existing cosmetic reformatting changes in logic_gameplay.py that were already in the working tree before this fix (not introduced by this PR's change). All changes are formatting-only and functionally equivalent.

## Summary Removes the duplicate `sheets.open_by_key(this_team.gsheet)` call on line 1161 of `command_logic/logic_gameplay.py`. The function called the Google Sheets API twice back-to-back with no logic between the calls, causing an unnecessary round-trip. ## Changes - `command_logic/logic_gameplay.py`: removed redundant second `sheets.open_by_key()` call ## Other observations The commit also includes pre-existing cosmetic reformatting changes in `logic_gameplay.py` that were already in the working tree before this fix (not introduced by this PR's change). All changes are formatting-only and functionally equivalent.
cal added 1 commit 2026-03-05 09:32:47 +00:00
fix: remove duplicate sheets.open_by_key() call in get_full_roster_from_sheets (#30)
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m10s
abffbab1e2
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cal added the
ai-reviewing
label 2026-03-05 09:45:32 +00:00
cal reviewed 2026-03-05 09:46:28 +00:00
cal left a comment
Author
Owner

AI Code Review

Files Reviewed

  • command_logic/logic_gameplay.py (modified)

Findings

Correctness

  • Core fix verified: The duplicate sheets.open_by_key(this_team.gsheet) call is confirmed in the pre-patch file. Lines 1159–1161 show two consecutive calls with no logic between them — the first result is immediately overwritten. Removing the first call is correct and eliminates an unnecessary Google Sheets API round-trip.
  • All formatting-only hunks are functionally equivalent to the original code: ternary expressions wrapped in parentheses, list comprehension reformatted across lines, function signature parameters expanded, and a tuple unpacking expanded. None alter control flow or values.

Security

  • No issues found. No new inputs, credentials, or external interactions introduced.

Style & Conventions

  • Formatting changes follow Black/PEP8 style (parenthesized multiline expressions). Consistent with the existing codebase style.
  • No issues found.

Suggestions

  • None.

Verdict: APPROVED

Simple, correct fix. The duplicate API call removal is unambiguous and the accompanying reformatting is safe and style-consistent. No concerns.


Automated review by Claude PR Reviewer

## AI Code Review ### Files Reviewed - `command_logic/logic_gameplay.py` (modified) ### Findings #### Correctness - **Core fix verified**: The duplicate `sheets.open_by_key(this_team.gsheet)` call is confirmed in the pre-patch file. Lines 1159–1161 show two consecutive calls with no logic between them — the first result is immediately overwritten. Removing the first call is correct and eliminates an unnecessary Google Sheets API round-trip. - All formatting-only hunks are functionally equivalent to the original code: ternary expressions wrapped in parentheses, list comprehension reformatted across lines, function signature parameters expanded, and a tuple unpacking expanded. None alter control flow or values. #### Security - No issues found. No new inputs, credentials, or external interactions introduced. #### Style & Conventions - Formatting changes follow Black/PEP8 style (parenthesized multiline expressions). Consistent with the existing codebase style. - No issues found. #### Suggestions - None. ### Verdict: APPROVED Simple, correct fix. The duplicate API call removal is unambiguous and the accompanying reformatting is safe and style-consistent. No concerns. --- *Automated review by Claude PR Reviewer*
cal added
ai-reviewed
and removed
ai-reviewing
labels 2026-03-05 09:46:33 +00:00
cal changed target branch from main to next-release 2026-03-07 07:32:29 +00:00
cal force-pushed ai/paper-dynasty-discord-30 from abffbab1e2 to ceff1bcb9b 2026-03-07 07:33:45 +00:00 Compare
cal merged commit 5bd538bb6f into next-release 2026-03-07 07:42:27 +00:00
cal deleted branch ai/paper-dynasty-discord-30 2026-03-07 07:42:27 +00:00
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/paper-dynasty-discord#56
No description provided.