From c02ecb5c4f3d57da490a24e150cd386ad69580bd Mon Sep 17 00:00:00 2001 From: AvitalFineRedis Date: Wed, 13 Oct 2021 15:57:21 +0200 Subject: [PATCH 1/6] raise NotImplementedError --- redis/commands.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/redis/commands.py b/redis/commands.py index eb7cea54f6..b1e43a922d 100644 --- a/redis/commands.py +++ b/redis/commands.py @@ -568,11 +568,16 @@ def migrate(self, host, port, keys, destination_db, timeout, timeout, *pieces) def object(self, infotype, key): - "Return the encoding, idletime, or refcount about the key" + """Return the encoding, idletime, or refcount about the key""" return self.execute_command('OBJECT', infotype, key, infotype=infotype) + def memory_doctor(self): + raise NotImplementedError( + "MEMORY DOCTOR is not supported in the client." + ) + def memory_stats(self): - "Return a dictionary of memory stats" + """Return a dictionary of memory stats""" return self.execute_command('MEMORY STATS') def memory_usage(self, key, samples=None): @@ -590,15 +595,16 @@ def memory_usage(self, key, samples=None): return self.execute_command('MEMORY USAGE', key, *args) def memory_purge(self): - "Attempts to purge dirty pages for reclamation by allocator" + """Attempts to purge dirty pages for reclamation by allocator""" return self.execute_command('MEMORY PURGE') def ping(self): - "Ping the Redis server" + """Ping the Redis server""" return self.execute_command('PING') def quit(self): - """Ask the server to close the connection. + """ + Ask the server to close the connection. https://redis.io/commands/quit """ return self.execute_command('QUIT') From 9d92ca78fe694d57bfaf6929dcd40dc707302d2e Mon Sep 17 00:00:00 2001 From: AvitalFineRedis Date: Wed, 13 Oct 2021 16:00:09 +0200 Subject: [PATCH 2/6] stam --- redis/commands.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/redis/commands.py b/redis/commands.py index b1e43a922d..1524bfd323 100644 --- a/redis/commands.py +++ b/redis/commands.py @@ -373,7 +373,7 @@ def client_list(self, _type=None, client_id=[]): return self.execute_command('CLIENT LIST', *args) def client_getname(self): - "Returns the current connection name" + """Returns the current connection name""" return self.execute_command('CLIENT GETNAME') def client_reply(self, reply): @@ -396,11 +396,12 @@ def client_reply(self, reply): return self.execute_command("CLIENT REPLY", reply) def client_id(self): - "Returns the current connection id" + """Returns the current connection id""" return self.execute_command('CLIENT ID') def client_trackinginfo(self): - """Returns the information about the current client connection's + """ + Returns the information about the current client connection's use of the server assisted client side cache. See https://redis.io/commands/client-trackinginfo """ @@ -438,15 +439,15 @@ def client_unpause(self): return self.execute_command('CLIENT UNPAUSE') def readwrite(self): - "Disables read queries for a connection to a Redis Cluster slave node" + """Disables read queries for a connection to a Redis Cluster slave node""" return self.execute_command('READWRITE') def readonly(self): - "Enables read queries for a connection to a Redis Cluster replica node" + """Enables read queries for a connection to a Redis Cluster replica node""" return self.execute_command('READONLY') def config_get(self, pattern="*"): - "Return a dictionary of configuration based on the ``pattern``" + """Return a dictionary of configuration based on the ``pattern``""" return self.execute_command('CONFIG GET', pattern) def config_set(self, name, value): @@ -454,23 +455,23 @@ def config_set(self, name, value): return self.execute_command('CONFIG SET', name, value) def config_resetstat(self): - "Reset runtime statistics" + """Reset runtime statistics""" return self.execute_command('CONFIG RESETSTAT') def config_rewrite(self): - "Rewrite config file with the minimal change to reflect running config" + """Rewrite config file with the minimal change to reflect running config""" return self.execute_command('CONFIG REWRITE') def dbsize(self): - "Returns the number of keys in the current database" + """Returns the number of keys in the current database""" return self.execute_command('DBSIZE') def debug_object(self, key): - "Returns version specific meta information about a given key" + """Returns version specific meta information about a given key""" return self.execute_command('DEBUG OBJECT', key) def echo(self, value): - "Echo the string back from the server" + """Echo the string back from the server""" return self.execute_command('ECHO', value) def flushall(self, asynchronous=False): @@ -524,7 +525,8 @@ def lastsave(self): return self.execute_command('LASTSAVE') def lolwut(self, *version_numbers): - """Get the Redis version and a piece of generative computer art + """ + Get the Redis version and a piece of generative computer art See: https://redis.io/commands/lolwut """ if version_numbers: From b559b6d82df3214931d2b4cadc9d380127953b4f Mon Sep 17 00:00:00 2001 From: AvitalFineRedis Date: Wed, 13 Oct 2021 16:58:11 +0200 Subject: [PATCH 3/6] flake8 --- redis/commands.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/redis/commands.py b/redis/commands.py index 1524bfd323..11205cf3ce 100644 --- a/redis/commands.py +++ b/redis/commands.py @@ -439,11 +439,15 @@ def client_unpause(self): return self.execute_command('CLIENT UNPAUSE') def readwrite(self): - """Disables read queries for a connection to a Redis Cluster slave node""" + """ + Disables read queries for a connection to a Redis Cluster slave node. + """ return self.execute_command('READWRITE') def readonly(self): - """Enables read queries for a connection to a Redis Cluster replica node""" + """ + Enables read queries for a connection to a Redis Cluster replica node. + """ return self.execute_command('READONLY') def config_get(self, pattern="*"): @@ -459,7 +463,9 @@ def config_resetstat(self): return self.execute_command('CONFIG RESETSTAT') def config_rewrite(self): - """Rewrite config file with the minimal change to reflect running config""" + """ + Rewrite config file with the minimal change to reflect running config. + """ return self.execute_command('CONFIG REWRITE') def dbsize(self): From 4eeceb0b7ebdf8fb164d1c68cd9c64d320bf9241 Mon Sep 17 00:00:00 2001 From: AvitalFineRedis Date: Thu, 14 Oct 2021 08:40:57 +0200 Subject: [PATCH 4/6] Throw NotImplementedError --- redis/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/commands.py b/redis/commands.py index 11205cf3ce..4a8d430da2 100644 --- a/redis/commands.py +++ b/redis/commands.py @@ -581,7 +581,7 @@ def object(self, infotype, key): def memory_doctor(self): raise NotImplementedError( - "MEMORY DOCTOR is not supported in the client." + "MEMORY DOCTOR is intentionally not implemented in the client." ) def memory_stats(self): From 9c34614c1a998267b2ea454544a0fff243c0b943 Mon Sep 17 00:00:00 2001 From: AvitalFineRedis Date: Thu, 14 Oct 2021 09:03:02 +0200 Subject: [PATCH 5/6] Throw NotImplementedError --- redis/commands.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/redis/commands.py b/redis/commands.py index 4a8d430da2..bcb1c8457b 100644 --- a/redis/commands.py +++ b/redis/commands.py @@ -584,6 +584,11 @@ def memory_doctor(self): "MEMORY DOCTOR is intentionally not implemented in the client." ) + def memory_HELP(self): + raise NotImplementedError( + "MEMORY HELP is intentionally not implemented in the client." + ) + def memory_stats(self): """Return a dictionary of memory stats""" return self.execute_command('MEMORY STATS') From 5fb24c43af334d16878c0db5104270a76e73f188 Mon Sep 17 00:00:00 2001 From: AvitalFineRedis Date: Thu, 14 Oct 2021 11:48:56 +0200 Subject: [PATCH 6/6] Throw NotImplementedError --- redis/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/commands.py b/redis/commands.py index bcb1c8457b..23b5aac9ec 100644 --- a/redis/commands.py +++ b/redis/commands.py @@ -584,7 +584,7 @@ def memory_doctor(self): "MEMORY DOCTOR is intentionally not implemented in the client." ) - def memory_HELP(self): + def memory_help(self): raise NotImplementedError( "MEMORY HELP is intentionally not implemented in the client." )