Disable prettyPrint by default for Google Sheets API responses
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Locate the Sheets API discovery document in the repository and search for the prettyPrint parameter and its default. Change the documented default to false while preserving an explicit caller value, then run the relevant test suite or discovery-document tests to verify requests use prettyPrint=false by default.
Written by the indexing model from the issue text.
Description
Large Google Sheets API responses are currently pretty-printed by default. For machine-to-machine use, the additional whitespace and line breaks provide no benefit while increasing response size and I/O. When processing large responses, this can also contribute to unnecessary memory usage.
Describe the solution you'd like
Change the default value of prettyPrint from true to false for the Sheets API discovery document
and send prettyPrint=false unless the caller says otherwise.
Describe alternatives you've considered
The current workaround is to explicitly pass prettyPrint=False to every request. This works, but requires application code to opt out of an unnecessary default and is easy to miss, especially in codebases making many Sheets API requests.
Another option would be to modify the client code to inject prettyPrint=False, but changing the API discovery document's default seems simpler and more consistent with the intended API behavior.
Additional context
This is particularly relevant for applications processing large Sheets responses programmatically. Avoiding pretty printing would reduce the amount of data transferred and processed, as well as the memory required to hold the response in memory. For large responses, this can also help reduce peak process RSS.
As a bonus, this would make the default more appropriate for API clients, where responses are consumed programmatically rather than displayed directly to users.
- Dominant language
- Python
- Stars
- 8.9k
- Forks
- 2.6k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 15
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from googleapis/google-api-python-client
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 5/5 Over a week Newbie friendliness 1/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
samples type: docs
Difficulty 3/5 1-2 days Newbie friendliness 52/100
All issues in googleapis/google-api-python-client
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100