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

Commit e351298

Browse files
reivilibreclokep
andauthored
Fix type signature in simple_select_one_onecol and friends (#8241)
Co-authored-by: Patrick Cloke <[email protected]>
1 parent c619253 commit e351298

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

changelog.d/8241.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add type hints to `synapse.storage.database`.

synapse/storage/database.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ async def simple_select_one_onecol(
11041104
self,
11051105
table: str,
11061106
keyvalues: Dict[str, Any],
1107-
retcol: Iterable[str],
1107+
retcol: str,
11081108
allow_none: Literal[False] = False,
11091109
desc: str = "simple_select_one_onecol",
11101110
) -> Any:
@@ -1115,7 +1115,7 @@ async def simple_select_one_onecol(
11151115
self,
11161116
table: str,
11171117
keyvalues: Dict[str, Any],
1118-
retcol: Iterable[str],
1118+
retcol: str,
11191119
allow_none: Literal[True] = True,
11201120
desc: str = "simple_select_one_onecol",
11211121
) -> Optional[Any]:
@@ -1125,7 +1125,7 @@ async def simple_select_one_onecol(
11251125
self,
11261126
table: str,
11271127
keyvalues: Dict[str, Any],
1128-
retcol: Iterable[str],
1128+
retcol: str,
11291129
allow_none: bool = False,
11301130
desc: str = "simple_select_one_onecol",
11311131
) -> Optional[Any]:
@@ -1156,7 +1156,7 @@ def simple_select_one_onecol_txn(
11561156
txn: LoggingTransaction,
11571157
table: str,
11581158
keyvalues: Dict[str, Any],
1159-
retcol: Iterable[str],
1159+
retcol: str,
11601160
allow_none: Literal[False] = False,
11611161
) -> Any:
11621162
...
@@ -1168,7 +1168,7 @@ def simple_select_one_onecol_txn(
11681168
txn: LoggingTransaction,
11691169
table: str,
11701170
keyvalues: Dict[str, Any],
1171-
retcol: Iterable[str],
1171+
retcol: str,
11721172
allow_none: Literal[True] = True,
11731173
) -> Optional[Any]:
11741174
...
@@ -1179,7 +1179,7 @@ def simple_select_one_onecol_txn(
11791179
txn: LoggingTransaction,
11801180
table: str,
11811181
keyvalues: Dict[str, Any],
1182-
retcol: Iterable[str],
1182+
retcol: str,
11831183
allow_none: bool = False,
11841184
) -> Optional[Any]:
11851185
ret = cls.simple_select_onecol_txn(
@@ -1196,10 +1196,7 @@ def simple_select_one_onecol_txn(
11961196

11971197
@staticmethod
11981198
def simple_select_onecol_txn(
1199-
txn: LoggingTransaction,
1200-
table: str,
1201-
keyvalues: Dict[str, Any],
1202-
retcol: Iterable[str],
1199+
txn: LoggingTransaction, table: str, keyvalues: Dict[str, Any], retcol: str,
12031200
) -> List[Any]:
12041201
sql = ("SELECT %(retcol)s FROM %(table)s") % {"retcol": retcol, "table": table}
12051202

0 commit comments

Comments
 (0)