Skip to content

Commit

Permalink
Add support for ModuleCommands in cluster (#2951)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvora-h authored Sep 19, 2023
1 parent 2df75ad commit 6207641
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions redis/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ class AbstractRedisCluster:
"LATENCY HISTORY",
"LATENCY LATEST",
"LATENCY RESET",
"MODULE LIST",
"MODULE LOAD",
"MODULE UNLOAD",
"MODULE LOADEX",
],
DEFAULT_NODE,
),
Expand Down
4 changes: 4 additions & 0 deletions redis/commands/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@
AsyncFunctionCommands,
AsyncGearsCommands,
AsyncManagementCommands,
AsyncModuleCommands,
AsyncScriptCommands,
DataAccessCommands,
FunctionCommands,
GearsCommands,
ManagementCommands,
ModuleCommands,
PubSubCommands,
ResponseT,
ScriptCommands,
Expand Down Expand Up @@ -873,6 +875,7 @@ class RedisClusterCommands(
ScriptCommands,
FunctionCommands,
GearsCommands,
ModuleCommands,
RedisModuleCommands,
):
"""
Expand Down Expand Up @@ -903,6 +906,7 @@ class AsyncRedisClusterCommands(
AsyncScriptCommands,
AsyncFunctionCommands,
AsyncGearsCommands,
AsyncModuleCommands,
):
"""
A class for all Redis Cluster commands
Expand Down
1 change: 0 additions & 1 deletion tests/test_asyncio/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -3213,7 +3213,6 @@ async def test_memory_usage(self, r: redis.Redis):
assert isinstance(await r.memory_usage("foo"), int)

@skip_if_server_version_lt("4.0.0")
@pytest.mark.onlynoncluster
async def test_module_list(self, r: redis.Redis):
assert isinstance(await r.module_list(), list)
for x in await r.module_list():
Expand Down
1 change: 0 additions & 1 deletion tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4909,7 +4909,6 @@ def test_latency_latest(self, r: redis.Redis):
def test_latency_reset(self, r: redis.Redis):
assert r.latency_reset() == 0

@pytest.mark.onlynoncluster
@skip_if_server_version_lt("4.0.0")
@skip_if_redis_enterprise()
def test_module_list(self, r):
Expand Down

0 comments on commit 6207641

Please sign in to comment.