mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 11:33:53 +01:00
Correct type hint for room_batch.py (#11310)
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
This commit is contained in:
parent
48278a0d09
commit
8dc666f785
3 changed files with 12 additions and 11 deletions
1
changelog.d/11310.misc
Normal file
1
changelog.d/11310.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Add type hints to storage classes.
|
4
mypy.ini
4
mypy.ini
|
@ -46,7 +46,6 @@ exclude = (?x)
|
||||||
|synapse/storage/databases/main/push_rule.py
|
|synapse/storage/databases/main/push_rule.py
|
||||||
|synapse/storage/databases/main/receipts.py
|
|synapse/storage/databases/main/receipts.py
|
||||||
|synapse/storage/databases/main/room.py
|
|synapse/storage/databases/main/room.py
|
||||||
|synapse/storage/databases/main/room_batch.py
|
|
||||||
|synapse/storage/databases/main/roommember.py
|
|synapse/storage/databases/main/roommember.py
|
||||||
|synapse/storage/databases/main/search.py
|
|synapse/storage/databases/main/search.py
|
||||||
|synapse/storage/databases/main/signatures.py
|
|synapse/storage/databases/main/signatures.py
|
||||||
|
@ -183,6 +182,9 @@ disallow_untyped_defs = True
|
||||||
[mypy-synapse.storage.databases.main.client_ips]
|
[mypy-synapse.storage.databases.main.client_ips]
|
||||||
disallow_untyped_defs = True
|
disallow_untyped_defs = True
|
||||||
|
|
||||||
|
[mypy-synapse.storage.databases.main.room_batch]
|
||||||
|
disallow_untyped_defs = True
|
||||||
|
|
||||||
[mypy-synapse.storage.util.*]
|
[mypy-synapse.storage.util.*]
|
||||||
disallow_untyped_defs = True
|
disallow_untyped_defs = True
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,7 @@ class RoomBatchStore(SQLBaseStore):
|
||||||
|
|
||||||
async def store_state_group_id_for_event_id(
|
async def store_state_group_id_for_event_id(
|
||||||
self, event_id: str, state_group_id: int
|
self, event_id: str, state_group_id: int
|
||||||
) -> Optional[str]:
|
) -> None:
|
||||||
{
|
|
||||||
await self.db_pool.simple_upsert(
|
await self.db_pool.simple_upsert(
|
||||||
table="event_to_state_groups",
|
table="event_to_state_groups",
|
||||||
keyvalues={"event_id": event_id},
|
keyvalues={"event_id": event_id},
|
||||||
|
@ -48,4 +47,3 @@ class RoomBatchStore(SQLBaseStore):
|
||||||
# Unique constraint on event_id so we don't have to lock
|
# Unique constraint on event_id so we don't have to lock
|
||||||
lock=False,
|
lock=False,
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue