Skip to content

Commit 9d0d07d

Browse files
committed
Add missing type hints and fix code format
1 parent a8ad4df commit 9d0d07d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

synapse/storage/databases/main/search.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ async def search_msgs(
470470
count_args = args
471471
count_clauses = clauses
472472

473-
sqlite_highlights = []
473+
sqlite_highlights: List[str] = []
474474

475475
if isinstance(self.database_engine, PostgresEngine):
476476
search_query = search_term
@@ -533,7 +533,7 @@ async def search_msgs(
533533

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

536-
highlights = None
536+
highlights: Collection[str] = []
537537
if isinstance(self.database_engine, PostgresEngine):
538538
highlights = await self._find_highlights_in_postgres(search_query, events)
539539
else:
@@ -601,7 +601,7 @@ async def search_rooms(
601601
count_args = list(args)
602602
count_clauses = list(clauses)
603603

604-
sqlite_highlights = []
604+
sqlite_highlights: List[str] = []
605605

606606
if pagination_token:
607607
try:
@@ -700,7 +700,7 @@ async def search_rooms(
700700

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

703-
highlights = None
703+
highlights: Collection[str] = []
704704
if isinstance(self.database_engine, PostgresEngine):
705705
highlights = await self._find_highlights_in_postgres(search_query, events)
706706
else:
@@ -941,4 +941,3 @@ def _parse_query_for_sqlite(search_term: str) -> Tuple[str, List[str]]:
941941
that can be used as highlights.
942942
"""
943943
return _tokens_to_sqlite_match_query(_tokenize_query(search_term))
944-

0 commit comments

Comments
 (0)