Skip to content

Commit

Permalink
Uppercase commands in CommandsParser.get_keys
Browse files Browse the repository at this point in the history
  • Loading branch information
falk-h committed Jun 16, 2022
1 parent bedf3c8 commit 71365b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions redis/asyncio/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 71365b5

Please sign in to comment.