Skip to content

Commit

Permalink
Add types to execute method of pipelines (#3494)
Browse files Browse the repository at this point in the history
Co-authored-by: Vladyslav Vildanov <[email protected]>
  • Loading branch information
patrick91 and vladvildanov authored Feb 6, 2025
1 parent d989bcc commit 5342409
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion redis/asyncio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion redis/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,7 @@ def _disconnect_raise_reset(
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:
Expand Down
2 changes: 1 addition & 1 deletion redis/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down

0 comments on commit 5342409

Please sign in to comment.