Skip to content

Commit d2efeb2

Browse files
committed
doc update
Signed-off-by: TJ Zhang <tj.zhang@improving.com>
1 parent 1a21f57 commit d2efeb2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

python/python/glide/async_commands/cluster_commands.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,8 @@ async def script_exists(
12901290
TClusterResponse[List[bool]]: A list of boolean values indicating the existence of each script.
12911291
12921292
Examples:
1293-
>>> await client.script_exists(["sha1_digest1", "sha1_digest2"])
1293+
>>> lua_script = Script("return { KEYS[1], ARGV[1] }")
1294+
>>> await client.script_exists([lua_script.get_hash(), "sha1_digest2"])
12941295
[True, False]
12951296
"""
12961297
return cast(
@@ -1364,7 +1365,8 @@ async def invoke_script(
13641365
13651366
Args:
13661367
script (Script): The Lua script to execute.
1367-
keys (Optional[List[TEncodable]]): The keys that are used in the script.
1368+
keys (Optional[List[TEncodable]]): The keys that are used in the script. To ensure the correct execution of
1369+
the script, all names of keys that a script accesses must be explicitly provided as `keys`.
13681370
args (Optional[List[TEncodable]]): The arguments for the script.
13691371
13701372
Returns:
@@ -1394,8 +1396,7 @@ async def invoke_script_route(
13941396
13951397
Args:
13961398
script (Script): The Lua script to execute.
1397-
args (Optional[List[TEncodable]]): The arguments for the script.
1398-
route (Optional[Route]): The command will be routed automatically to all nodes, unless `route` is provided, in which
1399+
args (Optional[List[TEncodable]]): The non-key arguments for the script. route (Optional[Route]): The command will be routed automatically to all nodes, unless `route` is provided, in which
13991400
case the client will route the command to the nodes defined by `route`. Defaults to None.
14001401
14011402
Returns:
@@ -1406,4 +1407,6 @@ async def invoke_script_route(
14061407
>>> await invoke_script(lua_script, args=["bar"], route=AllPrimaries());
14071408
[b"foo", b"bar"]
14081409
"""
1409-
return await self._execute_script(script.get_hash(), keys=None, args=args, route=route)
1410+
return await self._execute_script(
1411+
script.get_hash(), keys=None, args=args, route=route
1412+
)

0 commit comments

Comments
 (0)