From f35d35d9ec480f0fcf0cc03209ac37b0c435d95f Mon Sep 17 00:00:00 2001 From: dvora-h Date: Wed, 27 Apr 2022 14:21:51 +0300 Subject: [PATCH] throw NotImplementedError --- redis/commands/core.py | 9 +++++++++ tests/test_commands.py | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/redis/commands/core.py b/redis/commands/core.py index 606256a33c..961bc7c3ed 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -1044,6 +1044,15 @@ def memory_purge(self, **kwargs) -> ResponseT: """ return self.execute_command("MEMORY PURGE", **kwargs) + def latency_histogram(self, *args): + """ + This function throws a NotImplementedError since it is intentionally + not supported. + """ + raise NotImplementedError( + "LATENCY HISTOGRAM is intentionally not implemented in the client." + ) + def ping(self, **kwargs) -> ResponseT: """ Ping the Redis server diff --git a/tests/test_commands.py b/tests/test_commands.py index de94539b82..d6a1526ffd 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -4420,6 +4420,11 @@ def test_memory_usage(self, r): r.set("foo", "bar") assert isinstance(r.memory_usage("foo"), int) + @skip_if_server_version_lt("7.0.0") + def test_latency_histogram_not_implemented(self, r: redis.Redis): + with pytest.raises(NotImplementedError): + r.latency_histogram() + @pytest.mark.onlynoncluster @skip_if_server_version_lt("4.0.0") @skip_if_redis_enterprise()