Skip to content

Commit 8fa2f7b

Browse files
committed
Add types to execute method of pipelines
1 parent ceb12fe commit 8fa2f7b

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

redis/asyncio/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,7 @@ async def _disconnect_raise_reset(self, conn: Connection, error: Exception):
15541554
await self.reset()
15551555
raise
15561556

1557-
async def execute(self, raise_on_error: bool = True):
1557+
async def execute(self, raise_on_error: bool = True) -> List[Any]:
15581558
"""Execute all the commands in the current pipeline"""
15591559
stack = self.command_stack
15601560
if not stack and not self.watching:

redis/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,11 +1551,10 @@ def _disconnect_raise_reset(
15511551
conn.retry_on_error is None
15521552
or isinstance(error, tuple(conn.retry_on_error)) is False
15531553
):
1554-
15551554
self.reset()
15561555
raise error
15571556

1558-
def execute(self, raise_on_error=True):
1557+
def execute(self, raise_on_error: bool = True) -> List[Any]:
15591558
"""Execute all the commands in the current pipeline"""
15601559
stack = self.command_stack
15611560
if not stack and not self.watching:

redis/cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2050,7 +2050,7 @@ def annotate_exception(self, exception, number, command):
20502050
)
20512051
exception.args = (msg,) + exception.args[1:]
20522052

2053-
def execute(self, raise_on_error=True):
2053+
def execute(self, raise_on_error: bool = True) -> List[Any]:
20542054
"""
20552055
Execute all the commands in the current pipeline
20562056
"""

0 commit comments

Comments
 (0)