Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Add additional typing.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Sep 2, 2020
1 parent fa3cb7f commit ca31cfe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions synapse/storage/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
Optional,
Tuple,
TypeVar,
cast,
overload,
)

Expand Down Expand Up @@ -507,8 +508,8 @@ def new_transaction(
sql_txn_timer.labels(desc).observe(duration)

async def runInteraction(
self, desc: str, func: Callable, *args: Any, **kwargs: Any
) -> Any:
self, desc: str, func: "Callable[..., R]", *args: Any, **kwargs: Any
) -> R:
"""Starts a transaction on the database and runs a given function
Arguments:
Expand Down Expand Up @@ -547,7 +548,7 @@ async def runInteraction(
after_callback(*after_args, **after_kwargs)
raise

return result
return cast(R, result)

async def runWithConnection(
self, func: "Callable[..., R]", *args: Any, **kwargs: Any
Expand Down

0 comments on commit ca31cfe

Please sign in to comment.