Skip to content

Commit

Permalink
Add missing type hints and fix code format
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaily committed Mar 19, 2024
1 parent b4dbcc5 commit a5edb6e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions synapse/storage/databases/main/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ async def search_msgs(
count_args = args
count_clauses = clauses

sqlite_highlights = []
sqlite_highlights : List[str] = []

if isinstance(self.database_engine, PostgresEngine):
search_query = search_term
Expand Down Expand Up @@ -533,7 +533,7 @@ async def search_msgs(

event_map = {ev.event_id: ev for ev in events}

highlights = None
highlights : Collection[str] = []
if isinstance(self.database_engine, PostgresEngine):
highlights = await self._find_highlights_in_postgres(search_query, events)
else:
Expand Down Expand Up @@ -601,7 +601,7 @@ async def search_rooms(
count_args = list(args)
count_clauses = list(clauses)

sqlite_highlights = []
sqlite_highlights : List[str] = []

if pagination_token:
try:
Expand Down Expand Up @@ -700,7 +700,7 @@ async def search_rooms(

event_map = {ev.event_id: ev for ev in events}

highlights = None
highlights : Collection[str] = []
if isinstance(self.database_engine, PostgresEngine):
highlights = await self._find_highlights_in_postgres(search_query, events)
else:
Expand Down Expand Up @@ -941,4 +941,3 @@ def _parse_query_for_sqlite(search_term: str) -> Tuple[str, List[str]]:
that can be used as highlights.
"""
return _tokens_to_sqlite_match_query(_tokenize_query(search_term))

0 comments on commit a5edb6e

Please sign in to comment.