Skip to content

Discover sheet names instead of assuming the English default - #2

Closed
pragmabits wants to merge 2 commits into
mainfrom
fix/locale-sheet-names
Closed

pragmabits wants to merge 2 commits into
mainfrom
fix/locale-sheet-names

Conversation

@pragmabits

Copy link
Copy Markdown
Owner

Problem

The live integration suite assumed the first sheet of a new spreadsheet is called Sheet1, which only holds for accounts in English. Google names it after the language of the owning account, so on a Portuguese account the sheet is Página1 and the test fails before reaching a single assertion:

HttpError 400: Unable to parse range: Sheet1!A1:D3

The tool docstrings and the README offered "Sheet1" as the example sheet name, which reads as a default. That misleads any LLM driving the server into guessing a name that does not exist outside English accounts.

Change

Two commits:

  1. Test — reads the name from list_sheets instead of hardcoding it (12 occurrences). Keeps passing in English, where list_sheets simply returns Sheet1.
  2. Docs — the sheet parameter now points at list_sheets, and list_sheets itself explains why the name has to be read rather than guessed.

Notes

  • No behaviour change in the server: the code never assumed a name, it always took one as a parameter. The assumption lived only in the test and in the docs.
  • The fix stays inside the test body rather than in create_test_spreadsheet, keeping the diff narrow.
  • Verified live against a Portuguese account: the previously failing test now exercises all 20 tools successfully.
  • Left test_server_unit.py alone — "Sheet1" there is synthetic data in fakes, never reaches Google, and works in any locale.

The suite assumed the first sheet of a new spreadsheet is called "Sheet1", which
only holds for accounts in English. Google names it after the language of the
owning account, so the test failed with "Unable to parse range" on any other
locale before reaching a single assertion. Read the name from list_sheets
instead, which keeps the test passing in English and everywhere else.
The tool docstrings and the README offered "Sheet1" as the example sheet name,
which reads as a default and is wrong for every account not in English. Point
callers at list_sheets instead, and say plainly on list_sheets itself why the
name has to be read rather than guessed.
@pragmabits pragmabits closed this Sep 2, 2026
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