diff --git a/backend/addresses/Addresses.py b/backend/addresses/Addresses.py index 0496e95e..4c046554 100644 --- a/backend/addresses/Addresses.py +++ b/backend/addresses/Addresses.py @@ -138,7 +138,10 @@ class Addresses: # Handle NAN if pd.isnull(lmk_key): lmk_key = None + epc_certificate_number = row.get("certificate_number", None) + if pd.isnull(epc_certificate_number): + epc_certificate_number = None landlord_heating_system = row.get("epc_heating_type", None) if pd.isnull(landlord_heating_system): diff --git a/backend/app/db/functions/epc_functions.py b/backend/app/db/functions/epc_functions.py index 1dcb92fe..90b2bd02 100644 --- a/backend/app/db/functions/epc_functions.py +++ b/backend/app/db/functions/epc_functions.py @@ -11,7 +11,7 @@ class EpcStoreService: Service layer for EPC data lookup and persistence. """ - FRESHNESS_DAYS = 180 # Upgraded to 180 days + FRESHNESS_DAYS = 30 # Upgraded to 30 days # status labels FRESH = "fresh" diff --git a/etl/bill_savings/KwhData.py b/etl/bill_savings/KwhData.py index 266f4b72..30e11698 100644 --- a/etl/bill_savings/KwhData.py +++ b/etl/bill_savings/KwhData.py @@ -203,7 +203,7 @@ class KwhData: # TODO: New is a temporary parameter, which will transform the epc descriptions to their transformed features # in anticipation of the new model - data["lodgement-date"] = pd.to_datetime(data["lodgement-date"]) + data["lodgement-date"] = pd.to_datetime(data["lodgement-date"], format="mixed", errors="coerce") data["lodgement-year"] = data["lodgement-date"].dt.year data["lodgement-month"] = data["lodgement-date"].dt.month @@ -331,8 +331,8 @@ class KwhData: def prepare_epc(self, input_properties: list[Property]): scoring_data = pd.DataFrame([self._prepare_epc(p) for p in input_properties]) - scoring_data["lodgement-year"] = pd.to_datetime(scoring_data["lodgement-date"]).dt.year - scoring_data["lodgement-month"] = pd.to_datetime(scoring_data["lodgement-date"]).dt.month + scoring_data["lodgement-year"] = pd.to_datetime(scoring_data["lodgement-date"], format="mixed").dt.year + scoring_data["lodgement-month"] = pd.to_datetime(scoring_data["lodgement-date"], format="mixed").dt.month scoring_data["id"] = scoring_data["uprn"].copy() diff --git a/etl/find_my_epc/RetrieveFindMyEpc.py b/etl/find_my_epc/RetrieveFindMyEpc.py index f5eb0166..16b7d8b9 100644 --- a/etl/find_my_epc/RetrieveFindMyEpc.py +++ b/etl/find_my_epc/RetrieveFindMyEpc.py @@ -734,6 +734,8 @@ class RetrieveFindMyEpc: "Step 1:": [], "Step 2:": [], 'Step 3:': [], + 'Step 4:': [], + 'Step 5:': [], "Biomass stove with boiler": [], "Replace boiler with biomass boiler": [], "Heating controls (room thermostat and thermostatic radiator valves)": [