added type hinting to uprn

This commit is contained in:
Jun-te Kim 2026-05-12 09:40:12 +00:00
parent 5edae06a65
commit c22528299c
2 changed files with 3 additions and 2 deletions

View file

@ -60,7 +60,7 @@ def get_uprn_from_historic_epc(
except FileNotFoundError:
return None
uprn = result.unambiguous_uprn()
uprn: Optional[str] = result.unambiguous_uprn()
if not uprn or uprn in ("", "nan"):
return None

View file

@ -12,6 +12,7 @@ Usage:
import sys
from datatypes.epc.domain.historic_epc_matching import match_addresses_for_postcode
from typing import Optional
def main(user_address: str, postcode: str) -> None:
@ -29,7 +30,7 @@ def main(user_address: str, postcode: str) -> None:
)
print()
uprn = result.unambiguous_uprn()
uprn: Optional[str] = result.unambiguous_uprn()
if uprn:
print(f"Unambiguous UPRN: {uprn}")
else: