X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/8d082c13e01f2c271318bb6ccf2a2f8e5000e315..105597be056bf9cbf3bb4c15f9bc516479e48ee2:/nominatim/db/connection.py?ds=sidebyside diff --git a/nominatim/db/connection.py b/nominatim/db/connection.py index 44a293d4..a64cbfaf 100644 --- a/nominatim/db/connection.py +++ b/nominatim/db/connection.py @@ -31,7 +31,7 @@ class Cursor(psycopg2.extras.DictCursor): """ Query execution that logs the SQL query when debugging is enabled. """ if LOG.isEnabledFor(logging.DEBUG): - LOG.debug(self.mogrify(query, args).decode('utf-8')) # type: ignore[no-untyped-call] + LOG.debug(self.mogrify(query, args).decode('utf-8')) # type: ignore[arg-type] super().execute(query, args) @@ -189,7 +189,7 @@ def connect(dsn: str) -> ConnectionContext: try: conn = psycopg2.connect(dsn, connection_factory=Connection) ctxmgr = cast(ConnectionContext, contextlib.closing(conn)) - ctxmgr.connection = cast(Connection, conn) + ctxmgr.connection = conn return ctxmgr except psycopg2.OperationalError as err: raise UsageError(f"Cannot connect to database: {err}") from err