Added missing type hints to DB queries

This commit is contained in:
Michael Hollister 2024-05-01 13:37:47 -05:00
parent 16a21470dd
commit c893e5a577

View file

@ -276,7 +276,19 @@ class PresenceStore(PresenceBackgroundUpdateStore, CacheInvalidationWorkerStore)
# TODO All these columns are nullable, but we don't expect that:
# https://github.com/matrix-org/synapse/issues/16467
rows = cast(
List[Tuple[str, str, int, int, int, Optional[str], Union[int, bool]]],
List[
Tuple[
str,
str,
int,
int,
int,
Optional[str],
Union[int, bool],
Optional[str],
Optional[str],
]
],
await self.db_pool.simple_select_many_batch(
table="presence_stream",
column="user_id",
@ -419,7 +431,19 @@ class PresenceStore(PresenceBackgroundUpdateStore, CacheInvalidationWorkerStore)
# TODO All these columns are nullable, but we don't expect that:
# https://github.com/matrix-org/synapse/issues/16467
rows = cast(
List[Tuple[str, str, int, int, int, Optional[str], Union[int, bool]]],
List[
Tuple[
str,
str,
int,
int,
int,
Optional[str],
Union[int, bool],
Optional[str],
Optional[str],
]
],
await self.db_pool.runInteraction(
"get_presence_for_all_users",
self.db_pool.simple_select_list_paginate_txn,