You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A warning can be raised within google.api_core.retry.retry_target depending on whether the return value of target() is awaitable in the following way:
ifinspect.isawaitable(target()):
raiseValueError("Incorrect use of Retry in async code. Use AsyncRetry instead")
This will ensure that google.api_core.retry.Retry is not incorrectly used in async clients/code and will suggest users to use google.api_core.retry_async.AsyncRetry instead
I think this change should be re-considered. inspect.isawaitable is notoriously slow, and this change makes it a part of every single rpc. I don't think the benefit of the extra warning is worth adding that performance cost to every library
A warning can be raised within
google.api_core.retry.retry_target
depending on whether the return value oftarget()
is awaitable in the following way:This will ensure that
google.api_core.retry.Retry
is not incorrectly used in async clients/code and will suggest users to usegoogle.api_core.retry_async.AsyncRetry
insteadrelated issue: fix retries in async client
The text was updated successfully, but these errors were encountered: