Skip to content

Commit f35d35d

Browse files
committed
throw NotImplementedError
1 parent cb91eed commit f35d35d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

redis/commands/core.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,15 @@ def memory_purge(self, **kwargs) -> ResponseT:
10441044
"""
10451045
return self.execute_command("MEMORY PURGE", **kwargs)
10461046

1047+
def latency_histogram(self, *args):
1048+
"""
1049+
This function throws a NotImplementedError since it is intentionally
1050+
not supported.
1051+
"""
1052+
raise NotImplementedError(
1053+
"LATENCY HISTOGRAM is intentionally not implemented in the client."
1054+
)
1055+
10471056
def ping(self, **kwargs) -> ResponseT:
10481057
"""
10491058
Ping the Redis server

tests/test_commands.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4420,6 +4420,11 @@ def test_memory_usage(self, r):
44204420
r.set("foo", "bar")
44214421
assert isinstance(r.memory_usage("foo"), int)
44224422

4423+
@skip_if_server_version_lt("7.0.0")
4424+
def test_latency_histogram_not_implemented(self, r: redis.Redis):
4425+
with pytest.raises(NotImplementedError):
4426+
r.latency_histogram()
4427+
44234428
@pytest.mark.onlynoncluster
44244429
@skip_if_server_version_lt("4.0.0")
44254430
@skip_if_redis_enterprise()

0 commit comments

Comments
 (0)