mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 05:14:07 +00:00
add explicit cast for fetchone
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
"""
|
"""
|
||||||
Functions for database analysis and maintenance.
|
Functions for database analysis and maintenance.
|
||||||
"""
|
"""
|
||||||
from typing import Optional, Tuple, Any
|
from typing import Optional, Tuple, Any, cast
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from psycopg2.extras import Json, register_hstore
|
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)
|
LOG.fatal("OSM object %s not found in database.", osm_id)
|
||||||
raise UsageError("OSM object not found")
|
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,
|
def analyse_indexing(config: Configuration, osm_id: Optional[str] = None,
|
||||||
|
|||||||
Reference in New Issue
Block a user