From d25a96b3f688e54cee8f76ba96ad0ae776342696 Mon Sep 17 00:00:00 2001 From: Kevin James Date: Fri, 23 Jun 2023 15:58:43 +0100 Subject: [PATCH] Fix type hint for retry_on_error in async cluster (#2804) * fix(asyncio.cluster): fixup retry_on_error type hint This parameter accepts a list of _classes of Exceptions_, not a list of instantiated Exceptions. Fixup the type hint accordingly. * chore: update changelog --------- Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> --- CHANGES | 1 + redis/asyncio/cluster.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 040e445228..49f87cd35d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,4 @@ + * Fix incorrect redis.asyncio.Cluster type hint for `retry_on_error` * Fix dead weakref in sentinel connection causing ReferenceError (#2767) * Fix #2768, Fix KeyError: 'first-entry' in parse_xinfo_stream. * Fix #2749, remove unnecessary __del__ logic to close connections. diff --git a/redis/asyncio/cluster.py b/redis/asyncio/cluster.py index 929d3e47c7..989c6ccda8 100644 --- a/redis/asyncio/cluster.py +++ b/redis/asyncio/cluster.py @@ -249,7 +249,7 @@ def __init__( socket_keepalive_options: Optional[Mapping[int, Union[int, bytes]]] = None, socket_timeout: Optional[float] = None, retry: Optional["Retry"] = None, - retry_on_error: Optional[List[Exception]] = None, + retry_on_error: Optional[List[Type[Exception]]] = None, # SSL related kwargs ssl: bool = False, ssl_ca_certs: Optional[str] = None,