diff --git a/backend/address2UPRN/main.py b/backend/address2UPRN/main.py index 0938a53b..a7378fbe 100644 --- a/backend/address2UPRN/main.py +++ b/backend/address2UPRN/main.py @@ -20,12 +20,15 @@ from backend.utils.addressMatch import ( df_has_single_uprn, score_addresses, ) +from datatypes.epc.domain.historic_epc_matching import ( + match_addresses_for_postcode, +) +from backend.epc_client.client import EpcClientService logger = setup_logger() def get_epc_data_with_postcode(postcode: str) -> pd.DataFrame: - from backend.epc_client.client import EpcClientService token = os.getenv("OPEN_EPC_API_TOKEN") if token is None: @@ -51,9 +54,6 @@ def get_uprn_from_historic_epc( here because historic addresses use a more verbose format that systematically depresses lexiscores. """ - from datatypes.epc.domain.historic_epc_matching import ( - match_addresses_for_postcode, - ) try: result = match_addresses_for_postcode(user_inputed_address, postcode) @@ -148,9 +148,7 @@ def get_uprn( postcode=postcode, ) if result: - logger.info( - f"Historic EPC matched {user_inputed_address} in {postcode}" - ) + logger.info(f"Historic EPC matched {user_inputed_address} in {postcode}") if not result: return None @@ -427,7 +425,6 @@ def handler(event, context, local=False): ) continue - # Process each address in this postcode with the same EPC data for row in postcode_rows: try: