This repository has been archived by the owner on Dec 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These errors are usually transient, and retrying might succeed. We retry 4 times (for a maximum of 5 requests in total), using an exponential backoff strategy. The maximum possible delay is thus 15 seconds. To deactivate the retry mechanism or change the maximum number of retries, adjust `api.NUM_RETRIES` after the initial import of the library.
Retry all requests that fail with a 50x error
Ignore worksheets that do not contain cells.
Retry "Rate exceeded" errors
This allows to provide query parameters for the call to the `spreadsheets.values.get` endpoint used to fetch worksheet content. The most useful application of this change is to download cell *formulas* instead of *values*.
For nearly all scenarios, we'd rather wait a bit longer than have our scripts blow up with a "ReadGroup" rate limit exception.
Increase maximum number of retries
This changes the OAuth2 functionality to use `google-auth` instead of `oauth2client`, which is [deprecated][0]. It adds a new argument `credentials` to the `API` constructor, which allows to either use an `Http` object as previously, or to directly supply a `google.oauth2.credentials.Credentials` instance. Existing code should thus continue to work unaffected. [0]: https://google-auth.readthedocs.io/en/latest/oauth2client-deprecation.html
Switch from oauth2client to google-auth
...instead of using a maximum number of retries. This is better suited to the way rate limiting within the Spreadsheet API seems to work.
Define a maximum amount of time to spend retrying requests
Recently we've been seeing read timeouts when accessing the Sheets API. This change makes hyou retry those as well.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
Whoops, wrong repo. Sorry about that! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.