Skip to content

Commit 30431f1

Browse files
committed
Type fixes
1 parent f62570d commit 30431f1

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

redis/asyncio/cluster.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def __init__(
238238
socket_keepalive_options: Optional[Mapping[int, Union[int, bytes]]] = None,
239239
socket_timeout: Optional[float] = None,
240240
retry: Optional["Retry"] = None,
241-
retry_on_error: Optional[list[Exception]] = None,
241+
retry_on_error: Optional[List[Exception]] = None,
242242
# SSL related kwargs
243243
ssl: bool = False,
244244
ssl_ca_certs: Optional[str] = None,
@@ -1165,8 +1165,8 @@ async def initialize(self) -> None:
11651165

11661166
if not startup_nodes_reachable:
11671167
raise RedisClusterException(
1168-
"Redis Cluster cannot be connected. Please provide at least "
1169-
"one reachable node"
1168+
f"Redis Cluster cannot be connected. Please provide at least "
1169+
f"one reachable node: {str(exception)}"
11701170
) from exception
11711171

11721172
# Check if the slots are not fully covered

redis/cluster.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import threading
55
import time
66
from collections import OrderedDict
7-
from typing import Any, Callable, Dict, Optional, Tuple, Union
7+
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
88

99
from redis.backoff import get_default_backoff
1010
from redis.client import CaseInsensitiveDict, PubSub, Redis, parse_scan
@@ -428,11 +428,11 @@ def __init__(
428428
self,
429429
host: Optional[str] = None,
430430
port: int = 6379,
431-
startup_nodes: Optional[list["ClusterNode"]] = None,
431+
startup_nodes: Optional[List["ClusterNode"]] = None,
432432
cluster_error_retry_attempts: int = 3,
433433
connection_error_retry_attempts: int = 3,
434434
retry: Optional["Retry"] = None,
435-
retry_on_error: Optional[list[Exception]] = None,
435+
retry_on_error: Optional[List[Exception]] = None,
436436
require_full_coverage: bool = False,
437437
reinitialize_steps: int = 10,
438438
read_from_replicas: bool = False,
@@ -1510,8 +1510,8 @@ def initialize(self):
15101510

15111511
if not startup_nodes_reachable:
15121512
raise RedisClusterException(
1513-
"Redis Cluster cannot be connected. Please provide at least "
1514-
"one reachable node"
1513+
f"Redis Cluster cannot be connected. Please provide at least "
1514+
f"one reachable node: {str(exception)}"
15151515
) from exception
15161516

15171517
# Create Redis connections to all nodes
@@ -1697,9 +1697,9 @@ def __init__(
16971697
self,
16981698
nodes_manager: "NodesManager",
16991699
commands_parser: "CommandsParser",
1700-
result_callbacks: Optional[dict[str, Callable]] = None,
1701-
cluster_response_callbacks: Optional[dict[str, Callable]] = None,
1702-
startup_nodes: Optional[list["ClusterNode"]] = None,
1700+
result_callbacks: Optional[Dict[str, Callable]] = None,
1701+
cluster_response_callbacks: Optional[Dict[str, Callable]] = None,
1702+
startup_nodes: Optional[List["ClusterNode"]] = None,
17031703
read_from_replicas: bool = False,
17041704
cluster_error_retry_attempts: int = 3,
17051705
reinitialize_steps: int = 10,

0 commit comments

Comments
 (0)