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

Commit b225acf

Browse files
dependabot[bot]David Robertson
andauthored
Bump types-psycopg2 from 2.9.21.11 to 2.9.21.14 (#16381)
* Bump types-psycopg2 from 2.9.21.11 to 2.9.21.14 Bumps [types-psycopg2](https://github.com/python/typeshed) from 2.9.21.11 to 2.9.21.14. - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-psycopg2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Relax the annotation of Cursor.description See #16343 (comment) for rationale. * Changelog * Changelog --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Robertson <davidr@element.io>
1 parent 139a24d commit b225acf

4 files changed

Lines changed: 9 additions & 32 deletions

File tree

changelog.d/16381.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve type hints, and bump types-psycopg2 from 2.9.21.11 to 2.9.21.14.

poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

synapse/storage/database.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -361,19 +361,7 @@ def rowcount(self) -> int:
361361
@property
362362
def description(
363363
self,
364-
) -> Optional[
365-
Sequence[
366-
Tuple[
367-
str,
368-
Optional[Any],
369-
Optional[int],
370-
Optional[int],
371-
Optional[int],
372-
Optional[int],
373-
Optional[int],
374-
]
375-
]
376-
]:
364+
) -> Optional[Sequence[Any]]:
377365
return self.txn.description
378366

379367
def execute_batch(self, sql: str, args: Iterable[Iterable[Any]]) -> None:

synapse/storage/types.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,10 @@ def fetchall(self) -> List[Tuple]:
5353
@property
5454
def description(
5555
self,
56-
) -> Optional[
57-
Sequence[
58-
# Note that this is an approximate typing based on sqlite3 and other
59-
# drivers, and may not be entirely accurate.
60-
# FWIW, the DBAPI 2 spec is: https://peps.python.org/pep-0249/#description
61-
Tuple[
62-
str,
63-
Optional[Any],
64-
Optional[int],
65-
Optional[int],
66-
Optional[int],
67-
Optional[int],
68-
Optional[int],
69-
]
70-
]
71-
]:
56+
) -> Optional[Sequence[Any]]:
57+
# At the time of writing, Synapse only assumes that `column[0]: str` for each
58+
# `column in description`. Since this is hard to express in the type system, and
59+
# as this is rarely used in Synapse, we deem `column: Any` good enough.
7260
...
7361

7462
@property

0 commit comments

Comments
 (0)