Skip to content

974 reduce sheets reads - #170

Merged
foobacca merged 6 commits into
mainfrom
974-reduce-sheets-reads
Oct 19, 2026
Merged

foobacca merged 6 commits into
mainfrom
974-reduce-sheets-reads

Conversation

@foobacca

Copy link
Copy Markdown
Collaborator

No description provided.

foobacca and others added 2 commits October 16, 2026 15:06
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Share the Drive access check between open_gsheet and inspect_gsheet, and
document the network and auth errors both can raise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread tests/test_gsheet.py Fixed
@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.68421% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/sortition_algorithms/adapters.py 97.8% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

foobacca and others added 4 commits October 19, 2026 10:06
Reuse one tab list fetch for reading input tabs and naming output tabs,
re-fetching it when older than tab_cache_max_age_seconds or when an input
tab is missing. Cuts a selection from about 14 Sheets reads to about 7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
client.open() builds a Spreadsheet, costing a Sheets read, only for us to
reopen it by id. Search Drive with list_spreadsheet_files() instead, taking
the first exact name match as client.open() does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Send a single batch_update with a deleteSheet request per tab, instead of
one del_worksheet() call each. The batch is atomic, so a failed deletion
leaves every tab in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@foobacca
foobacca merged commit 7ae8eff into main Oct 19, 2026
13 checks passed
@foobacca
foobacca deleted the 974-reduce-sheets-reads branch October 19, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant