Skip to content

Commit 89bc765

Browse files
committed
Changing the LoadBalancingStrategy type hints to be defined as optional. Fixed wording in pydocs
1 parent 523a233 commit 89bc765

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

redis/asyncio/cluster.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,14 @@ class RedisCluster(AbstractRedis, AbstractRedisCluster, AsyncRedisClusterCommand
124124
https://redis.io/docs/manual/scaling/#redis-cluster-configuration-parameters
125125
:param read_from_replicas:
126126
| @deprecated - please use load_balancing_strategy instead
127-
| Enable read from replicas in READONLY mode. You can read possibly stale data.
127+
| Enable read from replicas in READONLY mode.
128128
When set to true, read commands will be assigned between the primary and
129129
its replications in a Round-Robin manner.
130+
The data read from replicas is eventually consistent with the data in primary nodes.
130131
:param load_balancing_strategy:
131132
| Enable read from replicas in READONLY mode and defines the load balancing
132133
strategy that will be used for cluster node selection.
133-
You can read possibly stale data (when reading from replicas).
134+
The data read from replicas is eventually consistent with the data in primary nodes.
134135
:param reinitialize_steps:
135136
| Specifies the number of MOVED errors that need to occur before reinitializing
136137
the whole cluster topology. If a MOVED error occurs and the cluster does not
@@ -236,7 +237,7 @@ def __init__(
236237
startup_nodes: Optional[List["ClusterNode"]] = None,
237238
require_full_coverage: bool = True,
238239
read_from_replicas: bool = False,
239-
load_balancing_strategy: Union[LoadBalancingStrategy, None] = None,
240+
load_balancing_strategy: Optional[LoadBalancingStrategy] = None,
240241
reinitialize_steps: int = 5,
241242
cluster_error_retry_attempts: int = 3,
242243
connection_error_retry_attempts: int = 3,

redis/cluster.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ def __init__(
498498
require_full_coverage: bool = False,
499499
reinitialize_steps: int = 5,
500500
read_from_replicas: bool = False,
501-
load_balancing_strategy: Union["LoadBalancingStrategy", None] = None,
501+
load_balancing_strategy: Optional["LoadBalancingStrategy"] = None,
502502
dynamic_startup_nodes: bool = True,
503503
url: Optional[str] = None,
504504
address_remap: Optional[Callable[[Tuple[str, int]], Tuple[str, int]]] = None,
@@ -535,7 +535,7 @@ def __init__(
535535
:param load_balancing_strategy:
536536
Enable read from replicas in READONLY mode and defines the load balancing
537537
strategy that will be used for cluster node selection.
538-
You can read possibly stale data (when reading from replicas).
538+
The data read from replicas is eventually consistent with the data in primary nodes.
539539
:param dynamic_startup_nodes:
540540
Set the RedisCluster's startup nodes to all of the discovered nodes.
541541
If true (default value), the cluster's discovered nodes will be used to

0 commit comments

Comments
 (0)