diff --git a/etl/customers/goldman/property_ownership.py b/etl/customers/goldman/property_ownership.py index 17db71b2..4a6faede 100644 --- a/etl/customers/goldman/property_ownership.py +++ b/etl/customers/goldman/property_ownership.py @@ -42,6 +42,7 @@ def app(): freehold_matching_lookup = [] leasehold_matching_lookup = [] + shared_leasehold_match = [] for _, address in tqdm(properties.iterrows(), total=len(properties)): filtered = company_ownership[ company_ownership["Postcode"].str.lower() == address["POSTCODE"].lower() @@ -62,9 +63,10 @@ def app(): raise ValueError("Multiple freehold matches") if filtered_leasehold.shape[0] > 1: - raise ValueError("Multiple leasehold matches") - - if not filtered_leasehold.empty: + matched = filtered_leasehold[["Title Number"]].copy() + matched.insert(0, "UPRN", address["UPRN"]) + shared_leasehold_match.append(matched) + elif not filtered_leasehold.empty: leasehold_matching_lookup.append( { "UPRN": address["UPRN"],