Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Bump types-psycopg2 from 2.9.21.11 to 2.9.21.14 #16381

Merged
merged 4 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/16381.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve type hints, and bump types-psycopg2 from 2.9.21.11 to 2.9.21.14.
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 1 addition & 13 deletions synapse/storage/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,19 +361,7 @@ def rowcount(self) -> int:
@property
def description(
self,
) -> Optional[
Sequence[
Tuple[
str,
Optional[Any],
Optional[int],
Optional[int],
Optional[int],
Optional[int],
Optional[int],
]
]
]:
) -> Optional[Sequence[Any]]:
return self.txn.description

def execute_batch(self, sql: str, args: Iterable[Iterable[Any]]) -> None:
Expand Down
20 changes: 4 additions & 16 deletions synapse/storage/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,10 @@ def fetchall(self) -> List[Tuple]:
@property
def description(
self,
) -> Optional[
Sequence[
# Note that this is an approximate typing based on sqlite3 and other
# drivers, and may not be entirely accurate.
# FWIW, the DBAPI 2 spec is: https://peps.python.org/pep-0249/#description
Tuple[
str,
Optional[Any],
Optional[int],
Optional[int],
Optional[int],
Optional[int],
Optional[int],
]
]
]:
) -> Optional[Sequence[Any]]:
# At the time of writing, Synapse only assumes that `column[0]: str` for each
# `column in description`. Since this is hard to express in the type system, and
# as this is rarely used in Synapse, we deem `column: Any` good enough.
...

@property
Expand Down
Loading