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

Commit

Permalink
Bump types-psycopg2 from 2.9.21.11 to 2.9.21.14 (#16381)
Browse files Browse the repository at this point in the history
* 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] <[email protected]>

* Relax the annotation of Cursor.description

See
#16343 (comment)
for rationale.

* Changelog

* Changelog

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Robertson <[email protected]>
  • Loading branch information
dependabot[bot] and David Robertson authored Sep 25, 2023
1 parent 139a24d commit b225acf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 32 deletions.
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

0 comments on commit b225acf

Please sign in to comment.