summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordvora-h <dvora.heller@redis.com>2021-12-21 10:38:58 +0200
committerdvora-h <dvora.heller@redis.com>2021-12-21 10:38:58 +0200
commit1757d97e0483bd27917124508ce52105b57d2994 (patch)
tree6e3912062d72126186f815d9e91a42a3ab15339b
parentb58cd9015a33aa39f04eb417e9e4496e2961efad (diff)
downloadredis-py-1757d97e0483bd27917124508ce52105b57d2994.tar.gz
fixing PR comments
-rw-r--r--redis/commands/json/commands.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/redis/commands/json/commands.py b/redis/commands/json/commands.py
index 626f2c1..a132b8e 100644
--- a/redis/commands/json/commands.py
+++ b/redis/commands/json/commands.py
@@ -231,7 +231,7 @@ class JSONCommands:
with open(file_name, "r") as fp:
file_content = loads(fp.read())
- return self.set(name, path, file_content, nx, xx, decode_keys)
+ return self.set(name, path, file_content, nx=nx, xx=xx, decode_keys=decode_keys)
def set_path(self, json_path, root_folder, nx=False, xx=False, decode_keys=False):
"""
@@ -247,13 +247,20 @@ class JSONCommands:
set_files_result = {}
for root, dirs, files in os.walk(root_folder):
for file in files:
+ file_path = os.path.join(root, file)
try:
- file_name = os.path.join(root, file).rsplit(".")[0]
- file_path = os.path.join(root, file)
- self.set_file(file_name, json_path, file_path, nx, xx, decode_keys)
- set_files_result[os.path.join(root, file)] = True
+ file_name = file_path.rsplit(".")[0]
+ self.set_file(
+ file_name,
+ json_path,
+ file_path,
+ nx=nx,
+ xx=xx,
+ decode_keys=decode_keys,
+ )
+ set_files_result[file_path] = True
except JSONDecodeError:
- set_files_result[os.path.join(root, file)] = False
+ set_files_result[file_path] = False
return set_files_result