X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/e37cfc64d2734bf67aedf44e57585d6bd5ff06af..b8385fc52de32231e64789cfbf56a246b18b38d8:/nominatim/db/properties.py diff --git a/nominatim/db/properties.py b/nominatim/db/properties.py index 3624c950..e8d5e0ca 100644 --- a/nominatim/db/properties.py +++ b/nominatim/db/properties.py @@ -12,7 +12,7 @@ from typing import Optional, cast from nominatim.db.connection import Connection def set_property(conn: Connection, name: str, value: str) -> None: - """ Add or replace the propery with the given name. + """ Add or replace the property with the given name. """ with conn.cursor() as cur: cur.execute('SELECT value FROM nominatim_properties WHERE property = %s', @@ -41,4 +41,7 @@ def get_property(conn: Connection, name: str) -> Optional[str]: if cur.rowcount == 0: return None - return cast(Optional[str], cur.fetchone()[0]) # type: ignore[no-untyped-call] + result = cur.fetchone() + assert result is not None + + return cast(Optional[str], result[0])