mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
hndling case where landlord uprn and landlord property id are the sames
This commit is contained in:
parent
47ad0e8275
commit
591ce54458
2 changed files with 12 additions and 3 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue