From 8fa2f7bc279093f8ca2ddb982028d0efb32497c6 Mon Sep 17 00:00:00 2001 From: Patrick Arminio Date: Mon, 3 Feb 2025 11:50:19 +0000 Subject: [PATCH] Add types to execute method of pipelines --- redis/asyncio/client.py | 2 +- redis/client.py | 3 +-- redis/cluster.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/redis/asyncio/client.py b/redis/asyncio/client.py index 9478d539d7..7c17938714 100644 --- a/redis/asyncio/client.py +++ b/redis/asyncio/client.py @@ -1554,7 +1554,7 @@ async def _disconnect_raise_reset(self, conn: Connection, error: Exception): await self.reset() raise - async def execute(self, raise_on_error: bool = True): + async def execute(self, raise_on_error: bool = True) -> List[Any]: """Execute all the commands in the current pipeline""" stack = self.command_stack if not stack and not self.watching: diff --git a/redis/client.py b/redis/client.py index a7c1364a10..d25d3fa193 100755 --- a/redis/client.py +++ b/redis/client.py @@ -1551,11 +1551,10 @@ def _disconnect_raise_reset( conn.retry_on_error is None or isinstance(error, tuple(conn.retry_on_error)) is False ): - self.reset() raise error - def execute(self, raise_on_error=True): + def execute(self, raise_on_error: bool = True) -> List[Any]: """Execute all the commands in the current pipeline""" stack = self.command_stack if not stack and not self.watching: diff --git a/redis/cluster.py b/redis/cluster.py index 8718493759..7551924826 100644 --- a/redis/cluster.py +++ b/redis/cluster.py @@ -2050,7 +2050,7 @@ def annotate_exception(self, exception, number, command): ) exception.args = (msg,) + exception.args[1:] - def execute(self, raise_on_error=True): + def execute(self, raise_on_error: bool = True) -> List[Any]: """ Execute all the commands in the current pipeline """