hndling case where landlord uprn and landlord property id are the sames

This commit is contained in:
Khalim Conn-Kowlessar 2025-02-20 08:26:09 +00:00
parent 47ad0e8275
commit 591ce54458
2 changed files with 12 additions and 3 deletions

View file

@ -297,6 +297,12 @@ class AssetList:
self.rename_map = {}
self.keep_variables = []
# Finally, we handle the case where the landlord's property ID is actually the OS UPRN
if self.landlord_uprn == self.landlord_property_id:
self.raw_asset_list[self.STANDARD_UPRN] = self.raw_asset_list[self.landlord_uprn].copy()
# Update the reference to landlord UPRn
self.landlord_uprn = self.STANDARD_UPRN
def _extract_address1(self, asset_list, full_address_col, postcode_col, method="first_two_words"):
if method not in self.ADDRESS_1_CLEANING_METHODS:

View file

@ -511,6 +511,7 @@ def app():
find_my_epc_data["Solar photovoltaics"] = False
# Retrieve just the data we need
epc_df = epc_df[
[
"row_id",
@ -527,21 +528,23 @@ def app():
"walls-description",
"floor-description",
"transaction-type",
# New fields needed
"secondheat-description",
"total-floor-area",
"construction-age-band",
"floor-height",
"number-habitable-rooms",
"mainheat-description",
#
"energy-consumption-current", # kwh/m2
'mainheatcont-description',
"energy-consumption-current",
"photo-supply",
]
].rename(
columns={"address1": "Address1 on EPC", "address": "Address on EPC", "postcode": "Postcode on EPC"}
)
asset_list.merge_data(epc_df)
asset_list.insert_
asset_list = asset_list.merge(
epc_df,
how="left",