]> git.openstreetmap.org Git - nominatim.git/commitdiff
add explicit cast for fetchone
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 18 Jul 2022 08:18:51 +0000 (10:18 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 18 Jul 2022 08:18:51 +0000 (10:18 +0200)
nominatim/tools/admin.py

index 49ba75261b92d212f09a3681969b152da1b84cd7..9fb944d3ada0b45e956396253ed2ebd3cdd2c856 100644 (file)
@@ -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,