mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-04 23:15:02 -04:00
Improve type hints in storage classes. (#11652)
By using cast and making ignores more specific.
This commit is contained in:
parent
f58b300d27
commit
f82d38ed2e
10 changed files with 44 additions and 34 deletions
|
@ -13,7 +13,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
import logging
|
||||
from typing import List, Optional, Tuple, Union
|
||||
from typing import List, Optional, Tuple, Union, cast
|
||||
|
||||
import attr
|
||||
|
||||
|
@ -399,7 +399,7 @@ class RelationsWorkerStore(SQLBaseStore):
|
|||
AND relation_type = ?
|
||||
"""
|
||||
txn.execute(sql, (event_id, room_id, RelationTypes.THREAD))
|
||||
count = txn.fetchone()[0] # type: ignore[index]
|
||||
count = cast(Tuple[int], txn.fetchone())[0]
|
||||
|
||||
return count, latest_event_id
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue