Skip to content
Snippets Groups Projects
Unverified Commit 29f06704 authored by Patrick Cloke's avatar Patrick Cloke Committed by GitHub
Browse files

Fix incorrect type hint in filtering code. (#12695)

parent 989fa330
No related branches found
No related tags found
No related merge requests found
Fixes an incorrect type hint for `Filter._check_event_relations`.
...@@ -19,6 +19,7 @@ from typing import ( ...@@ -19,6 +19,7 @@ from typing import (
TYPE_CHECKING, TYPE_CHECKING,
Awaitable, Awaitable,
Callable, Callable,
Collection,
Dict, Dict,
Iterable, Iterable,
List, List,
...@@ -444,9 +445,9 @@ class Filter: ...@@ -444,9 +445,9 @@ class Filter:
return room_ids return room_ids
async def _check_event_relations( async def _check_event_relations(
self, events: Iterable[FilterEvent] self, events: Collection[FilterEvent]
) -> List[FilterEvent]: ) -> List[FilterEvent]:
# The event IDs to check, mypy doesn't understand the ifinstance check. # The event IDs to check, mypy doesn't understand the isinstance check.
event_ids = [event.event_id for event in events if isinstance(event, EventBase)] # type: ignore[attr-defined] event_ids = [event.event_id for event in events if isinstance(event, EventBase)] # type: ignore[attr-defined]
event_ids_to_keep = set( event_ids_to_keep = set(
await self._store.events_have_relations( await self._store.events_have_relations(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment