diff --git a/CHANGES b/CHANGES index b7e238ebb3..2678218041 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,5 @@ + * Compare commands case-insensitively in the asyncio command parser * Allow negative `retries` for `Retry` class to retry forever * Add `items` parameter to `hset` signature * Create codeql-analysis.yml (#1988). Thanks @chayim diff --git a/redis/asyncio/parser.py b/redis/asyncio/parser.py index 9518c3f1a5..5faf8f8c57 100644 --- a/redis/asyncio/parser.py +++ b/redis/asyncio/parser.py @@ -55,14 +55,14 @@ async def get_keys(self, *args: Any) -> Optional[Tuple[str, ...]]: # try to split the command name and to take only the main command # e.g. 'memory' for 'memory usage' args = args[0].split() + list(args[1:]) - cmd_name = args[0] + cmd_name = args[0].upper() if cmd_name not in self.commands: # We'll try to reinitialize the commands cache, if the engine # version has changed, the commands may not be current await self.initialize() if cmd_name not in self.commands: raise RedisError( - f"{cmd_name.upper()} command doesn't exist in Redis commands" + f"{cmd_name} command doesn't exist in Redis commands" ) command = self.commands[cmd_name]