valkey-glide 1.3.5rc3__cp313-cp313-macosx_11_0_arm64.whl → 2.0.0rc6__cp313-cp313-macosx_11_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of valkey-glide might be problematic. Click here for more details.

Files changed (32) hide show
  1. glide/__init__.py +11 -7
  2. glide/async_commands/{transaction.py → batch.py} +1413 -987
  3. glide/async_commands/bitmap.py +94 -85
  4. glide/async_commands/cluster_commands.py +308 -123
  5. glide/async_commands/command_args.py +7 -6
  6. glide/async_commands/core.py +1304 -714
  7. glide/async_commands/server_modules/ft.py +83 -14
  8. glide/async_commands/server_modules/ft_options/ft_aggregate_options.py +15 -8
  9. glide/async_commands/server_modules/ft_options/ft_create_options.py +23 -11
  10. glide/async_commands/server_modules/ft_options/ft_profile_options.py +12 -7
  11. glide/async_commands/server_modules/ft_options/ft_search_options.py +12 -6
  12. glide/async_commands/server_modules/glide_json.py +134 -43
  13. glide/async_commands/server_modules/json_batch.py +157 -127
  14. glide/async_commands/sorted_set.py +39 -29
  15. glide/async_commands/standalone_commands.py +199 -95
  16. glide/async_commands/stream.py +94 -87
  17. glide/config.py +165 -105
  18. glide/constants.py +8 -4
  19. glide/glide.cpython-313-darwin.so +0 -0
  20. glide/glide_client.py +274 -95
  21. glide/logger.py +1 -1
  22. glide/protobuf/command_request_pb2.py +15 -15
  23. glide/protobuf/command_request_pb2.pyi +69 -46
  24. glide/protobuf/connection_request_pb2.py +15 -13
  25. glide/protobuf/connection_request_pb2.pyi +57 -29
  26. glide/protobuf/response_pb2.pyi +8 -9
  27. glide/protobuf_codec.py +7 -6
  28. glide/routes.py +41 -8
  29. {valkey_glide-1.3.5rc3.dist-info → valkey_glide-2.0.0rc6.dist-info}/METADATA +30 -11
  30. valkey_glide-2.0.0rc6.dist-info/RECORD +37 -0
  31. valkey_glide-1.3.5rc3.dist-info/RECORD +0 -37
  32. {valkey_glide-1.3.5rc3.dist-info → valkey_glide-2.0.0rc6.dist-info}/WHEEL +0 -0
@@ -2,17 +2,16 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Any, Dict, List, Mapping, Optional, Set, Union, cast
5
+ from typing import Dict, List, Mapping, Optional, Union, cast
6
6
 
7
- from glide.async_commands.command_args import Limit, ObjectType, OrderBy
7
+ from glide.async_commands.batch import ClusterBatch
8
+ from glide.async_commands.command_args import ObjectType
8
9
  from glide.async_commands.core import (
9
10
  CoreCommands,
10
11
  FlushMode,
11
12
  FunctionRestorePolicy,
12
13
  InfoSection,
13
- _build_sort_args,
14
14
  )
15
- from glide.async_commands.transaction import ClusterTransaction
16
15
  from glide.constants import (
17
16
  TOK,
18
17
  TClusterResponse,
@@ -37,13 +36,19 @@ class ClusterCommands(CoreCommands):
37
36
  See the [Valkey GLIDE Wiki](https://github.com/valkey-io/valkey-glide/wiki/General-Concepts#custom-command)
38
37
  for details on the restrictions and limitations of the custom command API.
39
38
 
40
- @example - Return a list of all pub/sub clients from all nodes:
39
+ This function should only be used for single-response commands. Commands that don't return complete response and awaits
40
+ (such as SUBSCRIBE), or that return potentially more than a single response (such as XREAD), or that change the
41
+ client's behavior (such as entering pub/sub mode on RESP2 connections) shouldn't be called using this function.
42
+
43
+ For example - Return a list of all pub/sub clients from all nodes::
44
+
45
+ await client.customCommand(["CLIENT", "LIST","TYPE", "PUBSUB"], AllNodes())
41
46
 
42
- connection.customCommand(["CLIENT", "LIST","TYPE", "PUBSUB"], AllNodes())
43
47
  Args:
44
48
  command_args (List[TEncodable]): List of the command's arguments, where each argument is either a string or bytes.
45
49
  Every part of the command, including the command name and subcommands, should be added as a separate value in args.
46
- route (Optional[Route]): The command will be routed automatically based on the passed command's default request policy, unless `route` is provided, in which
50
+ route (Optional[Route]): The command will be routed automatically based on the passed command's default request
51
+ policy, unless `route` is provided, in which
47
52
  case the client will route the command to the nodes defined by `route`. Defaults to None.
48
53
 
49
54
  Returns:
@@ -61,13 +66,16 @@ class ClusterCommands(CoreCommands):
61
66
  ) -> TClusterResponse[bytes]:
62
67
  """
63
68
  Get information and statistics about the server.
64
- See https://valkey.io/commands/info/ for details.
69
+
70
+ Starting from server version 7, command supports multiple section arguments.
71
+
72
+ See [valkey.io](https://valkey.io/commands/info/) for details.
65
73
 
66
74
  Args:
67
75
  sections (Optional[List[InfoSection]]): A list of InfoSection values specifying which sections of
68
- information to retrieve. When no parameter is provided, the default option is assumed.
76
+ information to retrieve. When no parameter is provided, the default option is assumed.
69
77
  route (Optional[Route]): The command will be routed to all primaries, unless `route` is provided, in which
70
- case the client will route the command to the nodes defined by `route`. Defaults to None.
78
+ case the client will route the command to the nodes defined by `route`. Defaults to None.
71
79
 
72
80
  Returns:
73
81
  TClusterResponse[bytes]: If a single node route is requested, returns a bytes string containing the information for
@@ -84,27 +92,139 @@ class ClusterCommands(CoreCommands):
84
92
 
85
93
  async def exec(
86
94
  self,
87
- transaction: ClusterTransaction,
95
+ batch: ClusterBatch,
96
+ raise_on_error: bool,
88
97
  route: Optional[TSingleNodeRoute] = None,
98
+ timeout: Optional[int] = None,
99
+ retry_server_error: bool = False,
100
+ retry_connection_error: bool = False,
89
101
  ) -> Optional[List[TResult]]:
90
102
  """
91
- Execute a transaction by processing the queued commands.
92
- See https://valkey.io/docs/topics/transactions/ for details on Transactions.
103
+ Executes a batch by processing the queued commands.
104
+
105
+ See [Valkey Transactions (Atomic Batches)](https://valkey.io/docs/topics/transactions/) for details.
106
+ See [Valkey Pipelines (Non-Atomic Batches)](https://valkey.io/docs/topics/pipelining/) for details.
107
+
108
+ #### Routing Behavior:
109
+
110
+ - If a `route` is specified:
111
+ - The entire batch is sent to the specified node.
112
+
113
+ - If no `route` is specified:
114
+ - Atomic batches (Transactions): Routed to the slot owner of the first key in the batch.
115
+ If no key is found, the request is sent to a random node.
116
+ - Non-atomic batches (Pipelines): Each command is routed to the node owning the corresponding
117
+ key's slot. If no key is present, routing follows the command's default request policy.
118
+ Multi-node commands are automatically split and dispatched to the appropriate nodes.
119
+
120
+ #### Behavior notes:
121
+
122
+ - Atomic Batches (Transactions): All key-based commands must map to the same hash slot.
123
+ If keys span different slots, the transaction will fail. If the transaction fails due to a
124
+ `WATCH` command, `exec` will return `None`.
125
+
126
+ #### Retry and Redirection:
127
+
128
+ - If a redirection error occurs:
129
+ - Atomic batches (Transactions): The entire transaction will be redirected.
130
+ - Non-atomic batches (Pipelines): Only commands that encountered redirection errors will be redirected.
131
+
132
+ - Retries for failures will be handled according to the `retry_server_error` and
133
+ `retry_connection_error` parameters.
93
134
 
94
135
  Args:
95
- transaction (ClusterTransaction): A `ClusterTransaction` object containing a list of commands to be executed.
96
- route (Optional[TSingleNodeRoute]): If `route` is not provided, the transaction will be routed to the slot owner of the
97
- first key found in the transaction. If no key is found, the command will be sent to a random node.
98
- If `route` is provided, the client will route the command to the nodes defined by `route`.
136
+ batch (ClusterBatch): A `ClusterBatch` object containing a list of commands to be executed.
137
+ raise_on_error (bool): Determines how errors are handled within the batch response. When set to
138
+ `True`, the first encountered error in the batch will be raised as a `RequestError`
139
+ exception after all retries and reconnections have been executed. When set to `False`,
140
+ errors will be included as part of the batch response array, allowing the caller to process both
141
+ successful and failed commands together. In this case, error details will be provided as
142
+ instances of `RequestError`.
143
+ route (Optional[TSingleNodeRoute]): Configures single-node routing for the batch request. The client
144
+ will send the batch to the specified node defined by `route`.
145
+
146
+ If a redirection error occurs:
147
+ - For Atomic Batches (Transactions), the entire transaction will be redirected.
148
+ - For Non-Atomic Batches (Pipelines), only the commands that encountered redirection errors
149
+ will be redirected.
150
+ timeout (Optional[int]): The duration in milliseconds that the client should wait for the batch request
151
+ to complete. This duration encompasses sending the request, awaiting a response from the server,
152
+ and any required reconnections or retries.
153
+
154
+ If the specified timeout is exceeded, a timeout error will be raised. If not explicitly set,
155
+ the client's default request timeout will be used.
156
+ retry_server_error (bool): If `True`, retriable server errors (e.g., `TRYAGAIN`) will trigger a retry.
157
+ Warning: Retrying server errors may cause commands targeting the same slot to execute out of order.
158
+ Note: Currently supported only for non-atomic batches. Recommended to increase timeout when enabled.
159
+ retry_connection_error (bool): If `True`, connection failures will trigger a retry. Warning:
160
+ Retrying connection errors may lead to duplicate executions, as it is unclear which commands have
161
+ already been processed. Note: Currently supported only for non-atomic batches. Recommended to increase
162
+ timeout when enabled.
99
163
 
100
164
  Returns:
101
- Optional[List[TResult]]: A list of results corresponding to the execution of each command
102
- in the transaction. If a command returns a value, it will be included in the list. If a command
103
- doesn't return a value, the list entry will be `None`.
104
- If the transaction failed due to a WATCH command, `exec` will return `None`.
105
- """
106
- commands = transaction.commands[:]
107
- return await self._execute_transaction(commands, route)
165
+ Optional[List[TResult]]: A list of results corresponding to the execution of each command in the batch.
166
+ If a command returns a value, it will be included in the list. If a command doesn't return a value,
167
+ the list entry will be `None`. If the batch failed due to a `WATCH` command, `exec` will return
168
+ `None`.
169
+
170
+ Examples:
171
+ # Example 1: Atomic Batch (Transaction)
172
+ >>> atomic_batch = ClusterBatch(is_atomic=True) # Atomic (Transaction)
173
+ >>> atomic_batch.set("key", "1")
174
+ >>> atomic_batch.incr("key")
175
+ >>> atomic_batch.get("key")
176
+ >>> atomic_result = await cluster_client.exec(atomic_batch, false)
177
+ >>> print(f"Atomic Batch Result: {atomic_result}")
178
+ # Expected Output: Atomic Batch Result: [OK, 2, 2]
179
+
180
+ # Example 2: Non-Atomic Batch (Pipeline)
181
+ >>> non_atomic_batch = ClusterBatch(is_atomic=False) # Non-Atomic (Pipeline)
182
+ >>> non_atomic_batch.set("key1", "value1")
183
+ >>> non_atomic_batch.set("key2", "value2")
184
+ >>> non_atomic_batch.get("key1")
185
+ >>> non_atomic_batch.get("key2")
186
+ >>> non_atomic_result = await cluster_client.exec(non_atomic_batch, false)
187
+ >>> print(f"Non-Atomic Batch Result: {non_atomic_result}")
188
+ # Expected Output: Non-Atomic Batch Result: [OK, OK, value1, value2]
189
+
190
+ # Example 3: Atomic batch with options
191
+ >>> atomic_batch = ClusterBatch(is_atomic=True)
192
+ >>> atomic_batch.set("key", "1")
193
+ >>> atomic_batch.incr("key")
194
+ >>> atomic_batch.get("key")
195
+ >>> atomic_result = await cluster_client.exec(
196
+ ... atomic_batch,
197
+ ... timeout=1000, # Set a timeout of 1000 milliseconds
198
+ ... raise_on_error=False # Do not raise an error on failure
199
+ ... )
200
+ >>> print(f"Atomic Batch Result: {atomic_result}")
201
+ # Output: Atomic Batch Result: [OK, 2, 2]
202
+
203
+ # Example 4: Non-atomic batch with retry options
204
+ >>> non_atomic_batch = ClusterBatch(is_atomic=False)
205
+ >>> non_atomic_batch.set("key1", "value1")
206
+ >>> non_atomic_batch.set("key2", "value2")
207
+ >>> non_atomic_batch.get("key1")
208
+ >>> non_atomic_batch.get("key2")
209
+ >>> non_atomic_result = await cluster_client.exec(
210
+ ... non_atomic_batch,
211
+ ... raise_on_error=False,
212
+ ... retry_server_error=True,
213
+ ... retry_connection_error=False
214
+ ... )
215
+ >>> print(f"Non-Atomic Batch Result: {non_atomic_result}")
216
+ # Output: Non-Atomic Batch Result: [OK, OK, value1, value2]
217
+ """
218
+ commands = batch.commands[:]
219
+ return await self._execute_batch(
220
+ commands,
221
+ batch.is_atomic,
222
+ raise_on_error,
223
+ retry_server_error,
224
+ retry_connection_error,
225
+ route,
226
+ timeout,
227
+ )
108
228
 
109
229
  async def config_resetstat(
110
230
  self,
@@ -112,11 +232,12 @@ class ClusterCommands(CoreCommands):
112
232
  ) -> TOK:
113
233
  """
114
234
  Resets the statistics reported by the server using the INFO and LATENCY HISTOGRAM commands.
115
- See https://valkey.io/commands/config-resetstat/ for details.
235
+
236
+ See [valkey.io](https://valkey.io/commands/config-resetstat/) for details.
116
237
 
117
238
  Args:
118
- route (Optional[Route]): The command will be routed automatically to all nodes, unless `route` is provided, in which
119
- case the client will route the command to the nodes defined by `route`. Defaults to None.
239
+ route (Optional[Route]): The command will be routed automatically to all nodes, unless `route` is provided, in
240
+ which case the client will route the command to the nodes defined by `route`. Defaults to None.
120
241
 
121
242
  Returns:
122
243
  OK: Returns "OK" to confirm that the statistics were successfully reset.
@@ -131,11 +252,12 @@ class ClusterCommands(CoreCommands):
131
252
  ) -> TOK:
132
253
  """
133
254
  Rewrite the configuration file with the current configuration.
134
- See https://valkey.io/commands/config-rewrite/ for details.
255
+
256
+ See [valkey.io](https://valkey.io/commands/config-rewrite/) for details.
135
257
 
136
258
  Args:
137
- route (Optional[TRoute]): The command will be routed automatically to all nodes, unless `route` is provided, in which
138
- case the client will route the command to the nodes defined by `route`. Defaults to None.
259
+ route (Optional[TRoute]): The command will be routed automatically to all nodes, unless `route` is provided, in
260
+ which case the client will route the command to the nodes defined by `route`. Defaults to None.
139
261
 
140
262
  Returns:
141
263
  OK: OK is returned when the configuration was rewritten properly. Otherwise an error is raised.
@@ -154,15 +276,18 @@ class ClusterCommands(CoreCommands):
154
276
  ) -> TClusterResponse[int]:
155
277
  """
156
278
  Returns the current connection id.
157
- See https://valkey.io/commands/client-id/ for more information.
279
+
280
+ See [valkey.io](https://valkey.io/commands/client-id/) for more information.
158
281
 
159
282
  Args:
160
283
  route (Optional[Route]): The command will be sent to a random node, unless `route` is provided, in which
161
- case the client will route the command to the nodes defined by `route`.
284
+ case the client will route the command to the nodes defined by `route`.
162
285
 
163
286
  Returns:
164
287
  TClusterResponse[int]: The id of the client.
288
+
165
289
  If a single node route is requested, returns a int representing the client's id.
290
+
166
291
  Otherwise, returns a dict of [byte , int] where each key contains the address of
167
292
  the queried node and the value contains the client's id.
168
293
  """
@@ -176,14 +301,14 @@ class ClusterCommands(CoreCommands):
176
301
  ) -> bytes:
177
302
  """
178
303
  Ping the server.
179
- See https://valkey.io/commands/ping/ for more details.
304
+
305
+ See [valkey.io](https://valkey.io/commands/ping/) for more details.
180
306
 
181
307
  Args:
182
308
  message (Optional[TEncodable]): An optional message to include in the PING command. If not provided,
183
- the server will respond with b"PONG". If provided, the server will respond with a copy of the message.
184
-
309
+ the server will respond with b"PONG". If provided, the server will respond with a copy of the message.
185
310
  route (Optional[Route]): The command will be sent to all primaries, unless `route` is provided, in which
186
- case the client will route the command to the nodes defined by `route`
311
+ case the client will route the command to the nodes defined by `route`
187
312
 
188
313
  Returns:
189
314
  bytes: b'PONG' if `message` is not provided, otherwise return a copy of `message`.
@@ -205,18 +330,21 @@ class ClusterCommands(CoreCommands):
205
330
  """
206
331
  Get the values of configuration parameters.
207
332
  Starting from server version 7, command supports multiple parameters.
208
- See https://valkey.io/commands/config-get/ for details.
333
+
334
+ See [valkey.io](https://valkey.io/commands/config-get/) for details.
209
335
 
210
336
  Args:
211
337
  parameters (List[TEncodable]): A list of configuration parameter names to retrieve values for.
212
-
213
338
  route (Optional[Route]): The command will be routed to a random node, unless `route` is provided,
214
- in which case the client will route the command to the nodes defined by `route`.
339
+ in which case the client will route the command to the nodes defined by `route`.
215
340
 
216
341
  Returns:
217
342
  TClusterResponse[Dict[bytes, bytes]]: A dictionary of values corresponding to the
218
343
  configuration parameters.
219
- When specifying a route other than a single node, response will be : {Address (bytes) : response (Dict[bytes, bytes]) , ... }
344
+ When specifying a route other than a single node, response will be::
345
+
346
+ {Address (bytes) : response (Dict[bytes, bytes]) , ... }
347
+
220
348
  with type of Dict[bytes, Dict[bytes, bytes]].
221
349
 
222
350
  Examples:
@@ -238,14 +366,14 @@ class ClusterCommands(CoreCommands):
238
366
  """
239
367
  Set configuration parameters to the specified values.
240
368
  Starting from server version 7, command supports multiple parameters.
241
- See https://valkey.io/commands/config-set/ for details.
369
+
370
+ See [valkey.io](https://valkey.io/commands/config-set/) for details.
242
371
 
243
372
  Args:
244
373
  parameters_map (Mapping[TEncodable, TEncodable]): A map consisting of configuration
245
- parameters and their respective values to set.
246
-
374
+ parameters and their respective values to set.
247
375
  route (Optional[Route]): The command will be routed to all nodes, unless `route` is provided,
248
- in which case the client will route the command to the nodes defined by `route`.
376
+ in which case the client will route the command to the nodes defined by `route`.
249
377
 
250
378
  Returns:
251
379
  OK: Returns OK if all configurations have been successfully set. Otherwise, raises an error.
@@ -267,17 +395,22 @@ class ClusterCommands(CoreCommands):
267
395
  ) -> TClusterResponse[Optional[bytes]]:
268
396
  """
269
397
  Get the name of the connection to which the request is routed.
270
- See https://valkey.io/commands/client-getname/ for more details.
398
+
399
+ See [valkey.io](https://valkey.io/commands/client-getname/) for more details.
271
400
 
272
401
  Args:
273
402
  route (Optional[Route]): The command will be routed to a random node, unless `route` is provided,
274
- in which case the client will route the command to the nodes defined by `route`.
403
+ in which case the client will route the command to the nodes defined by `route`.
275
404
 
276
405
  Returns:
277
406
  TClusterResponse[Optional[bytes]]: The name of the client connection as a bytes string if a name is set,
278
407
  or None if no name is assigned.
279
- When specifying a route other than a single node, response will be:
280
- {Address (bytes) : response (Optional[bytes]) , ... } with type of Dict[str, Optional[str]].
408
+
409
+ When specifying a route other than a single node, response will be::
410
+
411
+ {Address (bytes) : response (Optional[bytes]) , ... }
412
+
413
+ with type of Dict[str, Optional[str]].
281
414
 
282
415
  Examples:
283
416
  >>> await client.client_getname()
@@ -293,15 +426,18 @@ class ClusterCommands(CoreCommands):
293
426
  async def dbsize(self, route: Optional[Route] = None) -> int:
294
427
  """
295
428
  Returns the number of keys in the database.
296
- See https://valkey.io/commands/dbsize for more details.
429
+
430
+ See [valkey.io](https://valkey.io/commands/dbsize) for more details.
297
431
 
298
432
  Args:
299
433
  route (Optional[Route]): The command will be routed to all primaries, unless `route` is provided,
300
- in which case the client will route the command to the nodes defined by `route`.
434
+ in which case the client will route the command to the nodes defined by `route`.
301
435
 
302
436
  Returns:
303
437
  int: The number of keys in the database.
304
- In the case of routing the query to multiple nodes, returns the aggregated number of keys across the different nodes.
438
+
439
+ In the case of routing the query to multiple nodes, returns the aggregated number of keys across the
440
+ different nodes.
305
441
 
306
442
  Examples:
307
443
  >>> await client.dbsize()
@@ -315,17 +451,21 @@ class ClusterCommands(CoreCommands):
315
451
  """
316
452
  Echoes the provided `message` back.
317
453
 
318
- See https://valkey.io/commands/echo for more details.
454
+ See [valkey.io](https://valkey.io/commands/echo) for more details.
319
455
 
320
456
  Args:
321
457
  message (TEncodable): The message to be echoed back.
322
458
  route (Optional[Route]): The command will be routed to a random node, unless `route` is provided,
323
- in which case the client will route the command to the nodes defined by `route`.
459
+ in which case the client will route the command to the nodes defined by `route`.
324
460
 
325
461
  Returns:
326
462
  TClusterResponse[bytes]: The provided `message`.
327
- When specifying a route other than a single node, response will be:
328
- {Address (bytes) : response (bytes) , ... } with type of Dict[bytes, bytes].
463
+
464
+ When specifying a route other than a single node, response will be::
465
+
466
+ {Address (bytes) : response (bytes) , ... }
467
+
468
+ with type of Dict[bytes, bytes].
329
469
 
330
470
  Examples:
331
471
  >>> await client.echo(b"Valkey GLIDE")
@@ -347,7 +487,7 @@ class ClusterCommands(CoreCommands):
347
487
  """
348
488
  Loads a library to Valkey.
349
489
 
350
- See https://valkey.io/commands/function-load/ for more details.
490
+ See [valkey.io](https://valkey.io/commands/function-load/) for more details.
351
491
 
352
492
  Args:
353
493
  library_code (TEncodable): The source code that implements the library.
@@ -360,7 +500,7 @@ class ClusterCommands(CoreCommands):
360
500
  bytes: The library name that was loaded.
361
501
 
362
502
  Examples:
363
- >>> code = "#!lua name=mylib \n redis.register_function('myfunc', function(keys, args) return args[1] end)"
503
+ >>> code = "#!lua name=mylib \\n redis.register_function('myfunc', function(keys, args) return args[1] end)"
364
504
  >>> await client.function_load(code, True, RandomNode())
365
505
  b"mylib"
366
506
 
@@ -384,7 +524,7 @@ class ClusterCommands(CoreCommands):
384
524
  """
385
525
  Returns information about the functions and libraries.
386
526
 
387
- See https://valkey.io/commands/function-list/ for more details.
527
+ See [valkey.io](https://valkey.io/commands/function-list/) for more details.
388
528
 
389
529
  Args:
390
530
  library_name_pattern (Optional[TEncodable]): A wildcard pattern for matching library names.
@@ -406,7 +546,9 @@ class ClusterCommands(CoreCommands):
406
546
  b"description": None,
407
547
  b"flags": {b"no-writes"},
408
548
  }],
409
- b"library_code": b"#!lua name=mylib \n redis.register_function('myfunc', function(keys, args) return args[1] end)"
549
+ b"library_code":
550
+ b"#!lua name=mylib \\n redis.register_function('myfunc', function(keys, args) " \\
551
+ b"return args[1] end)"
410
552
  }]
411
553
 
412
554
  Since: Valkey 7.0.0.
@@ -431,7 +573,7 @@ class ClusterCommands(CoreCommands):
431
573
  """
432
574
  Deletes all function libraries.
433
575
 
434
- See https://valkey.io/commands/function-flush/ for more details.
576
+ See [valkey.io](https://valkey.io/commands/function-flush/) for more details.
435
577
 
436
578
  Args:
437
579
  mode (Optional[FlushMode]): The flushing mode, could be either `SYNC` or `ASYNC`.
@@ -462,10 +604,10 @@ class ClusterCommands(CoreCommands):
462
604
  """
463
605
  Deletes a library and all its functions.
464
606
 
465
- See https://valkey.io/commands/function-delete/ for more details.
607
+ See [valkey.io](https://valkey.io/commands/function-delete/) for more details.
466
608
 
467
609
  Args:
468
- library_code (TEncodable): The library name to delete
610
+ library_name (TEncodable): The library name to delete
469
611
  route (Optional[Route]): The command will be routed to all primaries, unless `route` is provided,
470
612
  in which case the client will route the command to the nodes defined by `route`.
471
613
 
@@ -492,7 +634,7 @@ class ClusterCommands(CoreCommands):
492
634
  Kills a function that is currently executing.
493
635
  This command only terminates read-only functions.
494
636
 
495
- See https://valkey.io/commands/function-kill/ for more details.
637
+ See [valkey.io](https://valkey.io/commands/function-kill/) for more details.
496
638
 
497
639
  Args:
498
640
  route (Optional[Route]): The command will be routed to all nodes, unless `route` is provided,
@@ -524,7 +666,8 @@ class ClusterCommands(CoreCommands):
524
666
  ) -> TClusterResponse[TResult]:
525
667
  """
526
668
  Invokes a previously loaded function.
527
- See https://valkey.io/commands/fcall/ for more details.
669
+
670
+ See [valkey.io](https://valkey.io/commands/fcall/) for more details.
528
671
 
529
672
  Args:
530
673
  function (TEncodable): The function name.
@@ -534,13 +677,18 @@ class ClusterCommands(CoreCommands):
534
677
  case the client will route the command to the nodes defined by `route`. Defaults to None.
535
678
 
536
679
  Returns:
537
- TClusterResponse[TResult]:
538
- If a single node route is requested, returns a Optional[TResult] representing the function's return value.
539
- Otherwise, returns a dict of [bytes , Optional[TResult]] where each key contains the address of
540
- the queried node and the value contains the function's return value.
680
+ TClusterResponse[TResult]: If a single node route is requested,
681
+ returns a Optional[TResult] representing the function's return value.
682
+
683
+ Otherwise, returns a dict of [bytes , Optional[TResult]] where each key contains the address of
684
+ the queried node and the value contains the function's return value.
541
685
 
542
686
  Example:
543
- >>> await client.fcall("Deep_Thought", ["Answer", "to", "the", "Ultimate", "Question", "of", "Life,", "the", "Universe,", "and", "Everything"], RandomNode())
687
+ >>> await client.fcall(
688
+ ... "Deep_Thought",
689
+ ... ["Answer", "to", "the", "Ultimate", "Question", "of", "Life,", "the", "Universe,", "and", "Everything"],
690
+ ... RandomNode()
691
+ ... )
544
692
  b'new_value' # Returns the function's return value.
545
693
 
546
694
  Since: Valkey version 7.0.0.
@@ -562,7 +710,7 @@ class ClusterCommands(CoreCommands):
562
710
  """
563
711
  Invokes a previously loaded read-only function.
564
712
 
565
- See https://valkey.io/commands/fcall_ro for more details.
713
+ See [valkey.io](https://valkey.io/commands/fcall_ro) for more details.
566
714
 
567
715
  Args:
568
716
  function (TEncodable): The function name.
@@ -595,17 +743,19 @@ class ClusterCommands(CoreCommands):
595
743
  Returns information about the function that's currently running and information about the
596
744
  available execution engines.
597
745
 
598
- See https://valkey.io/commands/function-stats/ for more details
746
+ See [valkey.io](https://valkey.io/commands/function-stats/) for more details
599
747
 
600
748
  Args:
601
- route (Optional[Route]): The command will be routed automatically to all nodes, unless `route` is provided, in which
602
- case the client will route the command to the nodes defined by `route`. Defaults to None.
749
+ route (Optional[Route]): The command will be routed automatically to all nodes, unless `route` is provided, in
750
+ which case the client will route the command to the nodes defined by `route`. Defaults to None.
603
751
 
604
752
  Returns:
605
753
  TClusterResponse[TFunctionStatsSingleNodeResponse]: A `Mapping` with two keys:
754
+
606
755
  - `running_script` with information about the running script.
607
756
  - `engines` with information about available engines and their stats.
608
- See example for more details.
757
+
758
+ See example for more details.
609
759
 
610
760
  Examples:
611
761
  >>> await client.function_stats(RandomNode())
@@ -636,7 +786,7 @@ class ClusterCommands(CoreCommands):
636
786
  """
637
787
  Returns the serialized payload of all loaded libraries.
638
788
 
639
- See https://valkey.io/commands/function-dump/ for more details.
789
+ See [valkey.io](https://valkey.io/commands/function-dump/) for more details.
640
790
 
641
791
  Args:
642
792
  route (Optional[Route]): The command will be routed to a random node, unless
@@ -669,7 +819,7 @@ class ClusterCommands(CoreCommands):
669
819
  """
670
820
  Restores libraries from the serialized payload returned by the `function_dump` command.
671
821
 
672
- See https://valkey.io/commands/function-restore/ for more details.
822
+ See [valkey.io](https://valkey.io/commands/function-restore/) for more details.
673
823
 
674
824
  Args:
675
825
  payload (bytes): The serialized data from the `function_dump` command.
@@ -706,24 +856,32 @@ class ClusterCommands(CoreCommands):
706
856
  """
707
857
  Returns the server time.
708
858
 
709
- See https://valkey.io/commands/time/ for more details.
859
+ See [valkey.io](https://valkey.io/commands/time/) for more details.
710
860
 
711
861
  Args:
712
862
  route (Optional[Route]): The command will be routed to a random node, unless `route` is provided,
713
- in which case the client will route the command to the nodes defined by `route`.
863
+ in which case the client will route the command to the nodes defined by `route`.
714
864
 
715
865
  Returns:
716
866
  TClusterResponse[Optional[bytes]]: The current server time as a two items `array`:
717
867
  A Unix timestamp and the amount of microseconds already elapsed in the current second.
718
868
  The returned `array` is in a [Unix timestamp, Microseconds already elapsed] format.
719
- When specifying a route other than a single node, response will be:
720
- {Address (bytes) : response (List[bytes]) , ... } with type of Dict[bytes, List[bytes]].
869
+
870
+ When specifying a route other than a single node, response will be::
871
+
872
+ {Address (bytes) : response (List[bytes]) , ... }
873
+
874
+ with type of Dict[bytes, List[bytes]].
721
875
 
722
876
  Examples:
723
877
  >>> await client.time()
724
878
  [b'1710925775', b'913580']
725
879
  >>> await client.time(AllNodes())
726
- {b'addr': [b'1710925775', b'913580'], b'addr2': [b'1710925775', b'913580'], b'addr3': [b'1710925775', b'913580']}
880
+ {
881
+ b'addr': [b'1710925775', b'913580'],
882
+ b'addr2': [b'1710925775', b'913580'],
883
+ b'addr3': [b'1710925775', b'913580']
884
+ }
727
885
  """
728
886
  return cast(
729
887
  TClusterResponse[List[bytes]],
@@ -734,7 +892,7 @@ class ClusterCommands(CoreCommands):
734
892
  """
735
893
  Returns the Unix time of the last DB save timestamp or startup timestamp if no save was made since then.
736
894
 
737
- See https://valkey.io/commands/lastsave for more details.
895
+ See [valkey.io](https://valkey.io/commands/lastsave) for more details.
738
896
 
739
897
  Args:
740
898
  route (Optional[Route]): The command will be routed to a random node, unless `route` is provided,
@@ -742,15 +900,19 @@ class ClusterCommands(CoreCommands):
742
900
 
743
901
  Returns:
744
902
  TClusterResponse[int]: The Unix time of the last successful DB save.
745
- If no route is provided, or a single node route is requested, returns an int representing the Unix time
746
- of the last successful DB save. Otherwise, returns a dict of [bytes , int] where each key contains the
747
- address of the queried node and the value contains the Unix time of the last successful DB save.
903
+
904
+ If no route is provided, or a single node route is requested, returns an int representing the Unix time
905
+ of the last successful DB save.
906
+
907
+ Otherwise, returns a dict of [bytes , int] where each key contains the
908
+ address of the queried node and the value contains the Unix time of the last successful DB save.
748
909
 
749
910
  Examples:
750
911
  >>> await client.lastsave()
751
912
  1710925775 # Unix time of the last DB save
752
913
  >>> await client.lastsave(AllNodes())
753
- {b'addr1': 1710925775, b'addr2': 1710925775, b'addr3': 1710925775} # Unix time of the last DB save on each node
914
+ {b'addr1': 1710925775, b'addr2': 1710925775, b'addr3': 1710925775} # Unix time of the last DB save on
915
+ # each node
754
916
  """
755
917
  return cast(
756
918
  TClusterResponse[int],
@@ -768,7 +930,9 @@ class ClusterCommands(CoreCommands):
768
930
  This command aggregates PUBLISH and SPUBLISH commands functionalities.
769
931
  The mode is selected using the 'sharded' parameter.
770
932
  For both sharded and non-sharded mode, request is routed using hashed channel as key.
771
- See https://valkey.io/commands/publish and https://valkey.io/commands/spublish for more details.
933
+
934
+ See [PUBLISH](https://valkey.io/commands/publish) and [SPUBLISH](https://valkey.io/commands/spublish)
935
+ for more details.
772
936
 
773
937
  Args:
774
938
  message (TEncodable): Message to publish.
@@ -796,15 +960,15 @@ class ClusterCommands(CoreCommands):
796
960
  Lists the currently active shard channels.
797
961
  The command is routed to all nodes, and aggregates the response to a single array.
798
962
 
799
- See https://valkey.io/commands/pubsub-shardchannels for more details.
963
+ See [valkey.io](https://valkey.io/commands/pubsub-shardchannels) for more details.
800
964
 
801
965
  Args:
802
966
  pattern (Optional[TEncodable]): A glob-style pattern to match active shard channels.
803
- If not provided, all active shard channels are returned.
967
+ If not provided, all active shard channels are returned.
804
968
 
805
969
  Returns:
806
970
  List[bytes]: A list of currently active shard channels matching the given pattern.
807
- If no pattern is specified, all active shard channels are returned.
971
+ If no pattern is specified, all active shard channels are returned.
808
972
 
809
973
  Examples:
810
974
  >>> await client.pubsub_shardchannels()
@@ -826,13 +990,14 @@ class ClusterCommands(CoreCommands):
826
990
  Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified shard channels.
827
991
 
828
992
  Note that it is valid to call this command without channels. In this case, it will just return an empty map.
829
- The command is routed to all nodes, and aggregates the response to a single map of the channels and their number of subscriptions.
993
+ The command is routed to all nodes, and aggregates the response to a single map of the channels and their number of
994
+ subscriptions.
830
995
 
831
- See https://valkey.io/commands/pubsub-shardnumsub for more details.
996
+ See [valkey.io](https://valkey.io/commands/pubsub-shardnumsub) for more details.
832
997
 
833
998
  Args:
834
999
  channels (Optional[List[TEncodable]]): The list of shard channels to query for the number of subscribers.
835
- If not provided, returns an empty map.
1000
+ If not provided, returns an empty map.
836
1001
 
837
1002
  Returns:
838
1003
  Mapping[bytes, int]: A map where keys are the shard channel names and values are the number of subscribers.
@@ -857,7 +1022,7 @@ class ClusterCommands(CoreCommands):
857
1022
  """
858
1023
  Deletes all the keys of all the existing databases. This command never fails.
859
1024
 
860
- See https://valkey.io/commands/flushall for more details.
1025
+ See [valkey.io](https://valkey.io/commands/flushall) for more details.
861
1026
 
862
1027
  Args:
863
1028
  flush_mode (Optional[FlushMode]): The flushing mode, could be either `SYNC` or `ASYNC`.
@@ -888,7 +1053,7 @@ class ClusterCommands(CoreCommands):
888
1053
  """
889
1054
  Deletes all the keys of the currently selected database. This command never fails.
890
1055
 
891
- See https://valkey.io/commands/flushdb for more details.
1056
+ See [valkey.io](https://valkey.io/commands/flushdb) for more details.
892
1057
 
893
1058
  Args:
894
1059
  flush_mode (Optional[FlushMode]): The flushing mode, could be either `SYNC` or `ASYNC`.
@@ -925,7 +1090,7 @@ class ClusterCommands(CoreCommands):
925
1090
  Copies the value stored at the `source` to the `destination` key. When `replace` is True,
926
1091
  removes the `destination` key first if it already exists, otherwise performs no action.
927
1092
 
928
- See https://valkey.io/commands/copy for more details.
1093
+ See [valkey.io](https://valkey.io/commands/copy) for more details.
929
1094
 
930
1095
  Note:
931
1096
  Both `source` and `destination` must map to the same hash slot.
@@ -964,20 +1129,26 @@ class ClusterCommands(CoreCommands):
964
1129
  """
965
1130
  Displays a piece of generative computer art and the Valkey version.
966
1131
 
967
- See https://valkey.io/commands/lolwut for more details.
1132
+ See [valkey.io](https://valkey.io/commands/lolwut) for more details.
968
1133
 
969
1134
  Args:
970
1135
  version (Optional[int]): Version of computer art to generate.
971
1136
  parameters (Optional[List[int]]): Additional set of arguments in order to change the output:
972
- For version `5`, those are length of the line, number of squares per row, and number of squares per column.
973
- For version `6`, those are number of columns and number of lines.
1137
+
1138
+ - For version `5`, those are length of the line, number of squares per row, and number of squares per column.
1139
+ - For version `6`, those are number of columns and number of lines.
1140
+
974
1141
  route (Optional[Route]): The command will be routed to a random node, unless `route` is provided,
975
1142
  in which case the client will route the command to the nodes defined by `route`.
976
1143
 
977
1144
  Returns:
978
1145
  TClusterResponse[bytes]: A piece of generative computer art along with the current Valkey version.
979
- When specifying a route other than a single node, response will be:
980
- {Address (bytes) : response (bytes) , ... } with type of Dict[bytes, bytes].
1146
+
1147
+ When specifying a route other than a single node, response will be::
1148
+
1149
+ {Address (bytes) : response (bytes) , ... }
1150
+
1151
+ with type of Dict[bytes, bytes].
981
1152
 
982
1153
  Examples:
983
1154
  >>> await client.lolwut(6, [40, 20], RandomNode());
@@ -998,7 +1169,7 @@ class ClusterCommands(CoreCommands):
998
1169
  """
999
1170
  Returns a random existing key name.
1000
1171
 
1001
- See https://valkey.io/commands/randomkey for more details.
1172
+ See [valkey.io](https://valkey.io/commands/randomkey) for more details.
1002
1173
 
1003
1174
  Args:
1004
1175
  route (Optional[Route]): The command will be routed to all primary nodes, unless `route` is provided,
@@ -1027,13 +1198,13 @@ class ClusterCommands(CoreCommands):
1027
1198
  and acknowledged by at least `numreplicas` of replicas. If `timeout` is
1028
1199
  reached, the command returns even if the specified number of replicas were not yet reached.
1029
1200
 
1030
- See https://valkey.io/commands/wait for more details.
1201
+ See [valkey.io](https://valkey.io/commands/wait) for more details.
1031
1202
 
1032
1203
  Args:
1033
1204
  numreplicas (int): The number of replicas to reach.
1034
1205
  timeout (int): The timeout value specified in milliseconds. A value of 0 will block indefinitely.
1035
1206
  route (Optional[Route]): The command will be routed to all primary nodes, unless `route` is provided,
1036
- in which case the client will route the command to the nodes defined by `route`.
1207
+ in which case the client will route the command to the nodes defined by `route`.
1037
1208
 
1038
1209
  Returns:
1039
1210
  int: The number of replicas reached by all the writes performed in the context of the current connection.
@@ -1041,7 +1212,7 @@ class ClusterCommands(CoreCommands):
1041
1212
  Examples:
1042
1213
  >>> await client.set("key", "value");
1043
1214
  >>> await client.wait(1, 1000);
1044
- // return 1 when a replica is reached or 0 if 1000ms is reached.
1215
+ # return 1 when a replica is reached or 0 if 1000ms is reached.
1045
1216
  """
1046
1217
  args: List[TEncodable] = [str(numreplicas), str(timeout)]
1047
1218
  return cast(
@@ -1054,7 +1225,7 @@ class ClusterCommands(CoreCommands):
1054
1225
  Flushes all the previously watched keys for a transaction. Executing a transaction will
1055
1226
  automatically flush all previously watched keys.
1056
1227
 
1057
- See https://valkey.io/commands/unwatch for more details.
1228
+ See [valkey.io](https://valkey.io/commands/unwatch) for more details.
1058
1229
 
1059
1230
  Args:
1060
1231
  route (Optional[Route]): The command will be routed to all primary nodes, unless `route` is provided,
@@ -1087,13 +1258,14 @@ class ClusterCommands(CoreCommands):
1087
1258
  This command is similar to the SCAN command but is designed to work in a cluster environment.
1088
1259
  For each iteration, the new cursor object should be used to continue the scan.
1089
1260
  Using the same cursor object for multiple iterations will result in the same keys or unexpected behavior.
1090
- For more information about the Cluster Scan implementation, see [Cluster Scan](https://github.com/valkey-io/valkey-glide/wiki/General-Concepts#cluster-scan).
1261
+ For more information about the Cluster Scan implementation, see
1262
+ [Cluster Scan](https://github.com/valkey-io/valkey-glide/wiki/General-Concepts#cluster-scan).
1091
1263
 
1092
1264
  Like the SCAN command, the method can be used to iterate over the keys in the database,
1093
1265
  returning all keys the database has from when the scan started until the scan ends.
1094
1266
  The same key can be returned in multiple scan iterations.
1095
1267
 
1096
- See https://valkey.io/commands/scan/ for more details.
1268
+ See [valkey.io](https://valkey.io/commands/scan/) for more details.
1097
1269
 
1098
1270
  Args:
1099
1271
  cursor (ClusterScanCursor): The cursor object that wraps the scan state.
@@ -1104,13 +1276,14 @@ class ClusterCommands(CoreCommands):
1104
1276
  This parameter serves as a hint to the server on the number of steps to perform in each iteration.
1105
1277
  The default value is 10.
1106
1278
  type (Optional[ObjectType]): The type of object to scan for.
1107
- allow_non_covered_slots (bool): If set to True, the scan will perform even if some slots are not covered by any node.
1279
+ allow_non_covered_slots (bool): If set to True, the scan will perform even if some slots are not covered by any
1280
+ node.
1108
1281
  It's important to note that when set to True, the scan has no guarantee to cover all keys in the cluster,
1109
1282
  and the method loses its way to validate the progress of the scan. Defaults to False.
1110
1283
 
1111
1284
  Returns:
1112
1285
  List[Union[ClusterScanCursor, List[TEncodable]]]: A list containing the next cursor and a list of keys,
1113
- formatted as [ClusterScanCursor, [key1, key2, ...]].
1286
+ formatted as [ClusterScanCursor, [key1, key2, ...]].
1114
1287
 
1115
1288
  Examples:
1116
1289
  >>> # Iterate over all keys in the cluster.
@@ -1123,7 +1296,14 @@ class ClusterCommands(CoreCommands):
1123
1296
  >>> print(all_keys) # [b'key1', b'key2', b'key3']
1124
1297
 
1125
1298
  >>> # Iterate over keys matching the pattern "*key*".
1126
- >>> await client.mset({b"key1": b"value1", b"key2": b"value2", b"not_my_key": b"value3", b"something_else": b"value4"})
1299
+ >>> await client.mset(
1300
+ ... {
1301
+ ... b"key1": b"value1",
1302
+ ... b"key2": b"value2",
1303
+ ... b"not_my_key": b"value3",
1304
+ ... b"something_else": b"value4"
1305
+ ... }
1306
+ ... )
1127
1307
  >>> cursor = ClusterScanCursor()
1128
1308
  >>> all_keys = []
1129
1309
  >>> while not cursor.is_finished():
@@ -1158,7 +1338,7 @@ class ClusterCommands(CoreCommands):
1158
1338
  """
1159
1339
  Check existence of scripts in the script cache by their SHA1 digest.
1160
1340
 
1161
- See https://valkey.io/commands/script-exists for more details.
1341
+ See [valkey.io](https://valkey.io/commands/script-exists) for more details.
1162
1342
 
1163
1343
  Args:
1164
1344
  sha1s (List[TEncodable]): List of SHA1 digests of the scripts to check.
@@ -1184,12 +1364,12 @@ class ClusterCommands(CoreCommands):
1184
1364
  """
1185
1365
  Flush the Lua scripts cache.
1186
1366
 
1187
- See https://valkey.io/commands/script-flush for more details.
1367
+ See [valkey.io](https://valkey.io/commands/script-flush) for more details.
1188
1368
 
1189
1369
  Args:
1190
1370
  mode (Optional[FlushMode]): The flushing mode, could be either `SYNC` or `ASYNC`.
1191
- route (Optional[Route]): The command will be routed automatically to all nodes, unless `route` is provided, in which
1192
- case the client will route the command to the nodes defined by `route`. Defaults to None.
1371
+ route (Optional[Route]): The command will be routed automatically to all nodes, unless `route` is provided, in
1372
+ which case the client will route the command to the nodes defined by `route`. Defaults to None.
1193
1373
 
1194
1374
  Returns:
1195
1375
  TOK: A simple `OK` response.
@@ -1214,12 +1394,14 @@ class ClusterCommands(CoreCommands):
1214
1394
  Kill the currently executing Lua script, assuming no write operation was yet performed by the script.
1215
1395
  The command is routed to all nodes, and aggregates the response to a single array.
1216
1396
 
1217
- See https://valkey.io/commands/script-kill for more details.
1397
+ See [valkey.io](https://valkey.io/commands/script-kill) for more details.
1398
+
1399
+ Args:
1400
+ route (Optional[Route]): The command will be routed automatically to all nodes, unless `route` is provided, in
1401
+ which case the client will route the command to the nodes defined by `route`. Defaults to None.
1218
1402
 
1219
1403
  Returns:
1220
1404
  TOK: A simple `OK` response.
1221
- route (Optional[Route]): The command will be routed automatically to all nodes, unless `route` is provided, in which
1222
- case the client will route the command to the nodes defined by `route`. Defaults to None.
1223
1405
 
1224
1406
  Examples:
1225
1407
  >>> await client.script_kill()
@@ -1240,9 +1422,11 @@ class ClusterCommands(CoreCommands):
1240
1422
  If the script has not already been loaded, it will be loaded automatically using the `SCRIPT LOAD` command.
1241
1423
  After that, it will be invoked using the `EVALSHA` command.
1242
1424
 
1243
- When in cluster mode, `key`s must map to the same hash slot.
1425
+ Note:
1426
+ When in cluster mode, each `key` must map to the same hash slot.
1244
1427
 
1245
- See https://valkey.io/commands/script-load/ and https://valkey.io/commands/evalsha/ for more details.
1428
+ See [SCRIPT LOAD](https://valkey.io/commands/script-load/) and [EVALSHA](https://valkey.io/commands/evalsha/)
1429
+ for more details.
1246
1430
 
1247
1431
  Args:
1248
1432
  script (Script): The Lua script to execute.
@@ -1273,13 +1457,14 @@ class ClusterCommands(CoreCommands):
1273
1457
  If the script has not already been loaded, it will be loaded automatically using the `SCRIPT LOAD` command.
1274
1458
  After that, it will be invoked using the `EVALSHA` command.
1275
1459
 
1276
- See https://valkey.io/commands/script-load/ and https://valkey.io/commands/evalsha/ for more details.
1460
+ See [SCRIPT LOAD](https://valkey.io/commands/script-load/) and [EVALSHA](https://valkey.io/commands/evalsha/)
1461
+ for more details.
1277
1462
 
1278
1463
  Args:
1279
1464
  script (Script): The Lua script to execute.
1280
1465
  args (Optional[List[TEncodable]]): The non-key arguments for the script.
1281
- route (Optional[Route]): The command will be routed automatically to a random node, unless `route` is provided, in which
1282
- case the client will route the command to the nodes defined by `route`. Defaults to None.
1466
+ route (Optional[Route]): The command will be routed automatically to a random node, unless `route` is provided, in
1467
+ which case the client will route the command to the nodes defined by `route`. Defaults to None.
1283
1468
 
1284
1469
  Returns:
1285
1470
  TResult: a value that depends on the script that was executed.