-
Notifications
You must be signed in to change notification settings - Fork 701
feat(sheets): extend the persisted batch primitive to structural spreadsheets.batchUpdate commands (batch-update covers values only) #1099
Copy link
Copy link
Closed
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Description
Activity
Metadata
Metadata
Assignees
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Type
Fields
Priority
None yet
What already exists, and what it does not cover
Two separate things are both called batching in
gog, and only one of them is on Sheets.gog sheets batch-update --data-jsonwrapsspreadsheets.values.batchUpdate. It writes values to several ranges in one request. That is useful and shipped.gog batch begin/list/show/end/abort/pruneplus--batch=<id>on the mutatingdocscommands wraps the accumulate-then-submit pattern againstdocuments.batchUpdate. Sheets has the same endpoint shape inspreadsheets.batchUpdate, and none of the structuralgog sheetscommands can reach it in a batch.gog batch begintakes--doconly.The commands that are one call each
Every one of these is a
spreadsheets.batchUpdaterequest type, and every one is its own process and its own API call on v0.39.0:sheets formatRepeatCell/UpdateCellssheets number-formatRepeatCellsheets conditional-format add/clearAddConditionalFormatRule/DeleteConditionalFormatRulesheets validationSetDataValidationsheets bandingAddBanding/UpdateBanding/DeleteBandingsheets filterSetBasicFilter/ClearBasicFiltersheets merge/unmergeMergeCells/UnmergeCellssheets freezeUpdateSheetPropertiessheets resize-columns/resize-rowsUpdateDimensionPropertiessheets insert/delete-dimensionInsertDimension/DeleteDimensionsheets copy-pasteCopyPastesheets update-noteRepeatCellon the note fieldsheets linksUpdateCellswithtextFormatRunssheets named-rangesAddNamedRange/DeleteNamedRangesheets tableAddTable/UpdateTablesheets chartAddChart/UpdateChartSpec/DeleteEmbeddedObjectsheets add-tab/rename-tab/delete-tab/reorder-tabAddSheet/UpdateSheetProperties/DeleteSheetsheets find-replaceFindReplaceThe cost
The documented Sheets quota is 60 write requests per minute per user per project (https://developers.google.com/workspace/sheets/api/limits), the same ceiling as Docs and Slides.
A formatting pass on a report sheet is not an exotic workload. Header row bold and filled, five column widths, a frozen header, a basic filter, three conditional-format rules, two number formats over separate ranges, a banded range, and two merges is 15 calls for a single tab. Repeat that across eight tabs and the run is 120 calls against a 60-per-minute ceiling, and half of it 429s. Batched, it is one
spreadsheets.batchUpdate, far inside the request cap.spreadsheets.batchUpdateis also the only way to get certain orderings right. Adding a chart that references a named range added in the same pass currently requires two calls with an implicit ordering the caller has to know about, where a single batch expresses it directly.What a caller has to do today
Insert sleeps between calls, or drop to a Google API client library for the structural pass and keep
gogfor values. Splitting one spreadsheet's write path across two auth mechanisms is the outcome nobody wants.Proposed surface
Same shape as the shipped Docs batch, so there is nothing new to learn:
--dry-run,--continue-on-error,--auto-splitand the revision lock behave as they do for Docs.spreadsheets.batchUpdateis atomic, so strict-atomic-by-default carries over unchanged.Out of scope for a batch:
get,read-format,notes,metadata,raw,exportare reads;updateandappendgo through the values endpoint rather thanspreadsheets.batchUpdateand are already served bybatch-update;createandcopycreate the file.If
gog batch begingrows one target flag per service the flags multiply, so a single--target <service>:<id>may age better than--doc/--presentation/--spreadsheetside by side. Either way the existing--docshould keep working.