Skip to content

Commit 2d8b901

Browse files
authored
support get multi parameters (#2142)
1 parent 2da2ac3 commit 2d8b901

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

redis/commands/core.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,13 +760,15 @@ def command_docs(self, *args):
760760
"COMMAND DOCS is intentionally not implemented in the client."
761761
)
762762

763-
def config_get(self, pattern: PatternT = "*", **kwargs) -> ResponseT:
763+
def config_get(
764+
self, pattern: PatternT = "*", *args: List[PatternT], **kwargs
765+
) -> ResponseT:
764766
"""
765767
Return a dictionary of configuration based on the ``pattern``
766768
767769
For more information see https://redis.io/commands/config-get
768770
"""
769-
return self.execute_command("CONFIG GET", pattern, **kwargs)
771+
return self.execute_command("CONFIG GET", pattern, *args, **kwargs)
770772

771773
def config_set(self, name: KeyT, value: EncodableT, **kwargs) -> ResponseT:
772774
"""Set config item ``name`` with ``value``

tests/test_commands.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,12 @@ def test_config_get(self, r):
669669
# # assert 'maxmemory' in data
670670
# assert data['maxmemory'].isdigit()
671671

672+
@skip_if_server_version_lt("7.0.0")
673+
def test_config_get_multi_params(self, r: redis.Redis):
674+
res = r.config_get("*max-*-entries*", "maxmemory")
675+
assert "maxmemory" in res
676+
assert "hash-max-listpack-entries" in res
677+
672678
@pytest.mark.onlynoncluster
673679
@skip_if_redis_enterprise()
674680
def test_config_resetstat(self, r):

0 commit comments

Comments
 (0)