From 5aad105c736a3866d222b31ee9bda8cf5454c8f9 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 18 Jul 2022 10:18:51 +0200 Subject: [PATCH] add explicit cast for fetchone --- nominatim/tools/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nominatim/tools/admin.py b/nominatim/tools/admin.py index 49ba7526..9fb944d3 100644 --- a/nominatim/tools/admin.py +++ b/nominatim/tools/admin.py @@ -7,7 +7,7 @@ """ Functions for database analysis and maintenance. """ -from typing import Optional, Tuple, Any +from typing import Optional, Tuple, Any, cast import logging from psycopg2.extras import Json, register_hstore @@ -49,7 +49,7 @@ def _get_place_info(cursor: Cursor, osm_id: Optional[str], LOG.fatal("OSM object %s not found in database.", osm_id) raise UsageError("OSM object not found") - return cursor.fetchone() # type: ignore[no-untyped-call] + return cast(DictCursorResult, cursor.fetchone()) # type: ignore[no-untyped-call] def analyse_indexing(config: Configuration, osm_id: Optional[str] = None, -- 2.39.5