summaryrefslogtreecommitdiff
path: root/redis/commands/json/__init__.py
diff options
context:
space:
mode:
authorChayim <chayim@users.noreply.github.com>2021-10-26 14:24:54 +0300
committerGitHub <noreply@github.com>2021-10-26 14:24:54 +0300
commit396e7323959b7a79d72602afee3ef648dc23adf9 (patch)
treec50ad4bdfe0760b7334fde8fc027bb72ef444a72 /redis/commands/json/__init__.py
parent866ac00b45a144753c40bb466e784a8917212172 (diff)
downloadredis-py-396e7323959b7a79d72602afee3ef648dc23adf9.tar.gz
Exposing the module version in loaded_modules (#1648)
This is useful for the case where one wants to instantiate a module, knowing the back end version. The reason: behaviour may differ based on redis module versions.
Diffstat (limited to 'redis/commands/json/__init__.py')
-rw-r--r--redis/commands/json/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/redis/commands/json/__init__.py b/redis/commands/json/__init__.py
index 92f1199..2e26de3 100644
--- a/redis/commands/json/__init__.py
+++ b/redis/commands/json/__init__.py
@@ -23,6 +23,7 @@ class JSON(JSONCommands):
def __init__(
self,
client,
+ version=None,
decoder=JSONDecoder(),
encoder=JSONEncoder(),
):
@@ -62,6 +63,7 @@ class JSON(JSONCommands):
self.client = client
self.execute_command = client.execute_command
+ self.MODULE_VERSION = version
for key, value in self.MODULE_CALLBACKS.items():
self.client.set_response_callback(key, value)