From ef7d5e393ddc08e0a1e2bec6930f64614e3989c9 Mon Sep 17 00:00:00 2001 From: dvora-h Date: Sun, 30 Jan 2022 05:00:35 +0200 Subject: [PATCH 1/6] unsupported hello --- redis/commands/core.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/redis/commands/core.py b/redis/commands/core.py index 73003e7fb6..ba7ee29b51 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -1069,6 +1069,11 @@ def wait(self, num_replicas, timeout, **kwargs): """ return self.execute_command("WAIT", num_replicas, timeout, **kwargs) + def hello(self): + raise NotImplementedError( + "HELLO is intentionally not implemented in the client." + ) + class BasicKeyCommands: """ From ccdd586831e6273badc0881dd21d10f1ff326708 Mon Sep 17 00:00:00 2001 From: dvora-h Date: Thu, 3 Feb 2022 12:07:38 +0200 Subject: [PATCH 2/6] add test and docstring --- redis/commands/core.py | 6 ++++++ tests/test_commands.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/redis/commands/core.py b/redis/commands/core.py index ba7ee29b51..b62766c7c7 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -1070,6 +1070,12 @@ def wait(self, num_replicas, timeout, **kwargs): return self.execute_command("WAIT", num_replicas, timeout, **kwargs) def hello(self): + """ + Switch to a different protocol, optionally authenticating and setting + the connection's name, or provide a contextual client report. + + For more information check https://redis.io/commands/hello + """ raise NotImplementedError( "HELLO is intentionally not implemented in the client." ) diff --git a/tests/test_commands.py b/tests/test_commands.py index b28b63ea6e..56bc2965c4 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -612,6 +612,11 @@ def test_client_reply(self, r, r_timeout): def test_client_getredir(self, r): assert isinstance(r.client_getredir(), int) assert r.client_getredir() == -1 + + @skip_if_server_version_lt("6.0.0") + def test_hello_notI_implemented(self, r): + with pytest.raises(NotImplementedError): + r.hello() def test_config_get(self, r): data = r.config_get() From c36fdd418f161e4046dea461f4a159eb88ade3a9 Mon Sep 17 00:00:00 2001 From: dvora-h Date: Thu, 3 Feb 2022 12:25:05 +0200 Subject: [PATCH 3/6] linters --- tests/test_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_commands.py b/tests/test_commands.py index 56bc2965c4..e01286cfe0 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -612,7 +612,7 @@ def test_client_reply(self, r, r_timeout): def test_client_getredir(self, r): assert isinstance(r.client_getredir(), int) assert r.client_getredir() == -1 - + @skip_if_server_version_lt("6.0.0") def test_hello_notI_implemented(self, r): with pytest.raises(NotImplementedError): From 14fed9685ccc15368d8d87dfe31518ee9bde0063 Mon Sep 17 00:00:00 2001 From: dvora-h Date: Sun, 6 Feb 2022 11:36:35 +0200 Subject: [PATCH 4/6] fix docstring --- redis/commands/core.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/redis/commands/core.py b/redis/commands/core.py index b62766c7c7..3c5b7ea61b 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -1071,10 +1071,8 @@ def wait(self, num_replicas, timeout, **kwargs): def hello(self): """ - Switch to a different protocol, optionally authenticating and setting - the connection's name, or provide a contextual client report. - - For more information check https://redis.io/commands/hello + This function throws a NotImplementedError since it is intentionally + not supported. """ raise NotImplementedError( "HELLO is intentionally not implemented in the client." From 3934b1ce7bbae6e639af626fed7d90e1062b1e48 Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Sun, 6 Feb 2022 12:15:48 +0200 Subject: [PATCH 5/6] linters --- redis/commands/core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/redis/commands/core.py b/redis/commands/core.py index 26824887e3..48ca6a7b95 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -1094,6 +1094,7 @@ def hello(self): """ raise NotImplementedError( "HELLO is intentionally not implemented in the client." + ) def failover(self): """ @@ -1102,6 +1103,7 @@ def failover(self): """ raise NotImplementedError( "FAILOVER is intentionally not implemented in the client." + ) class BasicKeyCommands: From c1c5eecea930a8fd1cbfbd15b97c2d788b65fd69 Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Sun, 6 Feb 2022 12:27:20 +0200 Subject: [PATCH 6/6] linters --- redis/commands/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/commands/core.py b/redis/commands/core.py index 48ca6a7b95..1b8cb80700 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -1086,7 +1086,7 @@ def wait(self, num_replicas, timeout, **kwargs): For more information check https://redis.io/commands/wait """ return self.execute_command("WAIT", num_replicas, timeout, **kwargs) - + def hello(self): """ This function throws a NotImplementedError since it is intentionally