mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
managing missing uprn in addresses objects
This commit is contained in:
parent
21348e7641
commit
06f4e79c80
1 changed files with 7 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import warnings
|
||||
import pandas as pd
|
||||
from typing import Iterator
|
||||
from backend.addresses.Address import Address
|
||||
from datatypes.epc.property_type_built_form import PropertyType
|
||||
|
|
@ -121,7 +122,12 @@ class Addresses:
|
|||
except (TypeError, ValueError):
|
||||
raise ValueError(f"Invalid UPRN value: {v}")
|
||||
|
||||
uprn = clean_uprn(row.get("uprn") or row.get("ordnance_survey_uprn"))
|
||||
uprn_option1 = row.get("uprn")
|
||||
uprn_option1 = uprn_option1 if not pd.isnull(uprn_option1) else None
|
||||
uprn_option2 = row.get("ordnance_survey_uprn")
|
||||
uprn_option2 = uprn_option2 if not pd.isnull(uprn_option2) else None
|
||||
|
||||
uprn = clean_uprn(uprn_option1 or uprn_option2)
|
||||
|
||||
address = row.get("address") or row.get("domna_address_1") or ""
|
||||
full_address = row.get("domna_full_address") or address or ""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue