From 34998360045b326ed3d1a0942b8bb344fb072473 Mon Sep 17 00:00:00 2001 From: vladvildanov Date: Fri, 28 Feb 2025 15:44:12 +0200 Subject: [PATCH 1/2] Fixing typing for FCALL commands to match PEP 484 --- redis/commands/core.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/redis/commands/core.py b/redis/commands/core.py index 6ab0602698..dc50feaa63 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -18,7 +18,7 @@ Sequence, Set, Tuple, - Union, + Union, Any, ) from redis.exceptions import ConnectionError, DataError, NoScriptError, RedisError @@ -6397,12 +6397,12 @@ def function_list( return self.execute_command("FUNCTION LIST", *args) def _fcall( - self, command: str, function, numkeys: int, *keys_and_args: Optional[List] + self, command: str, function, numkeys: int, *keys_and_args: Any ) -> Union[Awaitable[str], str]: return self.execute_command(command, function, numkeys, *keys_and_args) def fcall( - self, function, numkeys: int, *keys_and_args: Optional[List] + self, function, numkeys: int, *keys_and_args: Any ) -> Union[Awaitable[str], str]: """ Invoke a function. @@ -6412,7 +6412,7 @@ def fcall( return self._fcall("FCALL", function, numkeys, *keys_and_args) def fcall_ro( - self, function, numkeys: int, *keys_and_args: Optional[List] + self, function, numkeys: int, *keys_and_args: Any ) -> Union[Awaitable[str], str]: """ This is a read-only variant of the FCALL command that cannot From 36131e4fb3a4d78561a4afabeb723ed43c88be6b Mon Sep 17 00:00:00 2001 From: vladvildanov Date: Fri, 28 Feb 2025 15:47:29 +0200 Subject: [PATCH 2/2] Codestyle fixes --- redis/commands/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/redis/commands/core.py b/redis/commands/core.py index dc50feaa63..880d0fda41 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -5,6 +5,7 @@ import warnings from typing import ( TYPE_CHECKING, + Any, AsyncIterator, Awaitable, Callable, @@ -18,7 +19,7 @@ Sequence, Set, Tuple, - Union, Any, + Union, ) from redis.exceptions import ConnectionError, DataError, NoScriptError, RedisError