mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
added imports at the top of the file instead of function
This commit is contained in:
parent
1934c889b0
commit
5edae06a65
1 changed files with 5 additions and 8 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue