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

Commit

Permalink
Drive-by type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
reivilibre committed Jan 21, 2022
1 parent 75f1e2f commit 1b28e2f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions synapse/storage/databases/main/push_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
AbstractStreamIdTracker,
StreamIdGenerator,
)
from synapse.types import JsonDict
from synapse.util import json_encoder
from synapse.util.caches.descriptors import cached, cachedList
from synapse.util.caches.stream_change_cache import StreamChangeCache
Expand Down Expand Up @@ -126,7 +127,7 @@ def get_max_push_rules_stream_id(self):
raise NotImplementedError()

@cached(max_entries=5000)
async def get_push_rules_for_user(self, user_id):
async def get_push_rules_for_user(self, user_id: str) -> List[JsonDict]:
rows = await self.db_pool.simple_select_list(
table="push_rules",
keyvalues={"user_name": user_id},
Expand All @@ -150,7 +151,7 @@ async def get_push_rules_for_user(self, user_id):
return _load_rules(rows, enabled_map, use_new_defaults)

@cached(max_entries=5000)
async def get_push_rules_enabled_for_user(self, user_id) -> Dict[str, bool]:
async def get_push_rules_enabled_for_user(self, user_id: str) -> Dict[str, bool]:
results = await self.db_pool.simple_select_list(
table="push_rules_enable",
keyvalues={"user_name": user_id},
Expand Down

0 comments on commit 1b28e2f

Please sign in to comment.