Skip to content

Commit

Permalink
Fix incorrect assertion in argument version checking
Browse files Browse the repository at this point in the history
In the scenario where a method has more than one argument
that has a redis server version constraint, the command is blocked
even if the argument that has a failed version constraint isn't
provided by the caller.
  • Loading branch information
alisaifee committed Dec 5, 2024
1 parent 3cf8d97 commit 2fa0b71
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion coredis/commands/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,16 @@ async def check_version(
elif command_details.arguments and set(
command_details.arguments.keys()
).intersection(kwargs.keys()):
for argument, minimum_version in command_details.arguments.items():
for argument, minimum_version in [
(arg, ver)
for (arg, ver) in command_details.arguments.items()
if arg in kwargs
]:
if minimum_version and server_version < minimum_version:
if command_details.command == b"CLIENT KILL":
import pdb

pdb.set_trace()
raise CommandSyntaxError(
{argument},
(
Expand Down

0 comments on commit 2fa0b71

Please sign in to comment.