From c22528299ce1ba240263a3315537734dc0e456fd Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Tue, 12 May 2026 09:40:12 +0000 Subject: [PATCH] added type hinting to uprn --- backend/address2UPRN/main.py | 2 +- scripts/historic_epc_demo.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/address2UPRN/main.py b/backend/address2UPRN/main.py index a7378fbe..6b684cef 100644 --- a/backend/address2UPRN/main.py +++ b/backend/address2UPRN/main.py @@ -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 diff --git a/scripts/historic_epc_demo.py b/scripts/historic_epc_demo.py index b47c3a3c..31e1ee28 100644 --- a/scripts/historic_epc_demo.py +++ b/scripts/historic_epc_demo.py @@ -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: