mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:06:05 -04:00
Update type hints for Cursor to match PEP 249. (#9299)
This commit is contained in:
parent
5a9cdaa6e9
commit
d882fbca38
5 changed files with 48 additions and 18 deletions
|
@ -106,7 +106,9 @@ class PostgresSequenceGenerator(SequenceGenerator):
|
|||
|
||||
def get_next_id_txn(self, txn: Cursor) -> int:
|
||||
txn.execute("SELECT nextval(?)", (self._sequence_name,))
|
||||
return txn.fetchone()[0]
|
||||
fetch_res = txn.fetchone()
|
||||
assert fetch_res is not None
|
||||
return fetch_res[0]
|
||||
|
||||
def get_next_mult_txn(self, txn: Cursor, n: int) -> List[int]:
|
||||
txn.execute(
|
||||
|
@ -147,7 +149,9 @@ class PostgresSequenceGenerator(SequenceGenerator):
|
|||
txn.execute(
|
||||
"SELECT last_value, is_called FROM %(seq)s" % {"seq": self._sequence_name}
|
||||
)
|
||||
last_value, is_called = txn.fetchone()
|
||||
fetch_res = txn.fetchone()
|
||||
assert fetch_res is not None
|
||||
last_value, is_called = fetch_res
|
||||
|
||||
# If we have an associated stream check the stream_positions table.
|
||||
max_in_stream_positions = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue