From 5042bf7ff4f0c6302d2d40e0e6104747c271d2b0 Mon Sep 17 00:00:00 2001 From: trkwyk Date: Wed, 27 Sep 2023 21:43:37 +0800 Subject: [PATCH 1/3] Fix objlen type hint --- redis/commands/json/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/commands/json/commands.py b/redis/commands/json/commands.py index 0f92e0d6c9..6cfe5844c3 100644 --- a/redis/commands/json/commands.py +++ b/redis/commands/json/commands.py @@ -121,7 +121,7 @@ def objkeys( """ # noqa return self.execute_command("JSON.OBJKEYS", name, str(path)) - def objlen(self, name: str, path: Optional[str] = Path.root_path()) -> int: + def objlen(self, name: str, path: Optional[str] = Path.root_path()) -> List[Union[int, None]]: """Return the length of the dictionary JSON value under ``path`` at key ``name``. From 2450e50ebd1e746dd974828f37491ba9702f442e Mon Sep 17 00:00:00 2001 From: trkwyk <50520795+trkwyk@users.noreply.github.com> Date: Tue, 9 Jan 2024 22:27:40 +0800 Subject: [PATCH 2/3] Update redis/commands/json/commands.py Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> --- redis/commands/json/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/commands/json/commands.py b/redis/commands/json/commands.py index 6cfe5844c3..5465daeea9 100644 --- a/redis/commands/json/commands.py +++ b/redis/commands/json/commands.py @@ -121,7 +121,7 @@ def objkeys( """ # noqa return self.execute_command("JSON.OBJKEYS", name, str(path)) - def objlen(self, name: str, path: Optional[str] = Path.root_path()) -> List[Union[int, None]]: + def objlen(self, name: str, path: Optional[str] = Path.root_path()) -> List[Optional[int]]: """Return the length of the dictionary JSON value under ``path`` at key ``name``. From 53d28178f13488081cca29b09f40a688d47f6393 Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Tue, 9 Jan 2024 20:10:05 +0200 Subject: [PATCH 3/3] linters --- redis/commands/json/commands.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/redis/commands/json/commands.py b/redis/commands/json/commands.py index 969930a06a..b37dc37687 100644 --- a/redis/commands/json/commands.py +++ b/redis/commands/json/commands.py @@ -121,7 +121,9 @@ def objkeys( """ # noqa return self.execute_command("JSON.OBJKEYS", name, str(path), keys=[name]) - def objlen(self, name: str, path: Optional[str] = Path.root_path()) -> List[Optional[int]]: + def objlen( + self, name: str, path: Optional[str] = Path.root_path() + ) -> List[Optional[int]]: """Return the length of the dictionary JSON value under ``path`` at key ``name``.