Class ConditionalRetryPolicy (3.4.1)
Stay organized with collections
Save and categorize content based on your preferences.
ConditionalRetryPolicy(retry_policy, conditional_predicate, required_kwargs)
A class for use when an API call is only conditionally safe to retry.
This class is intended for use in inspecting the API call parameters of an
API call to verify that any flags necessary to make the API call idempotent
(such as specifying an if_generation_match
or related flag) are present.
It can be used in place of a retry.Retry
object, in which case
_http.Connection.api_request
will pass the requested api call keyword
arguments into the conditional_predicate
and return the retry_policy
if the conditions are met.
Parameters |
Name |
Description |
retry_policy |
class:google.api_core.retry.Retry
A retry object defining timeouts, persistence and which exceptions to retry.
|
conditional_predicate |
callable
A callable that accepts exactly the number of arguments in required_kwargs , in order, and returns True if the arguments have sufficient data to determine that the call is safe to retry (idempotent).
|
required_kwargs |
list(str)
A list of keyword argument keys that will be extracted from the API call and passed into the conditional predicate in order. For example, ["query_params"] is commmonly used for preconditions in query_params.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-10 UTC."],[],[]]