diff options
author | dvora-h <67596500+dvora-h@users.noreply.github.com> | 2022-04-27 16:21:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-27 16:21:29 +0300 |
commit | 683270557101cbfe26cad3eb4f187b7f8c218223 (patch) | |
tree | e50cd4f6c874e3a51e45f0ce6bb87037c7f4062b /redis/commands/core.py | |
parent | 6ba46418236718d95f9dee09adaa8a42a4d5c23b (diff) | |
download | redis-py-683270557101cbfe26cad3eb4f187b7f8c218223.tar.gz |
Update FUNCTION LOAD changes (#2139)
Diffstat (limited to 'redis/commands/core.py')
-rw-r--r-- | redis/commands/core.py | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/redis/commands/core.py b/redis/commands/core.py index d1d465d..8aa2dce 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -5703,28 +5703,20 @@ class FunctionCommands: def function_load( self, - engine: str, - library: str, code: str, replace: Optional[bool] = False, - description: Optional[str] = None, ) -> Union[Awaitable[str], str]: """ Load a library to Redis. - :param engine: the name of the execution engine for the library - :param library: the unique name of the library - :param code: the source code - :param replace: changes the behavior to replace the library if a library called - ``library`` already exists - :param description: description to the library + :param code: the source code (must start with + Shebang statement that provides a metadata about the library) + :param replace: changes the behavior to overwrite the existing library + with the new contents. + Return the library name that was loaded. For more information see https://redis.io/commands/function-load """ - pieces = [engine, library] - if replace: - pieces.append("REPLACE") - if description is not None: - pieces.append(description) + pieces = ["REPLACE"] if replace else [] pieces.append(code) return self.execute_command("FUNCTION LOAD", *pieces) |