From 654251c084b0c8f2729834235725187636c3c433 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 2 Jul 2024 12:25:16 +0100 Subject: [PATCH] handle case of no respone --- etl/bill_savings/data_collection.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/etl/bill_savings/data_collection.py b/etl/bill_savings/data_collection.py index 521a3783..2632c296 100644 --- a/etl/bill_savings/data_collection.py +++ b/etl/bill_savings/data_collection.py @@ -102,8 +102,8 @@ def retrieve_find_my_epc_data(uprn: int, postcode: str, address: str, expected_e hot_water_text = bills.find_all('li')[1].text resulting_data = { - 'uprn': uprn, - 'address': address, + 'extracted_uprn': uprn, + 'extracted_address': address, 'epc_certificate': epc_certificate, 'current_epc_rating': current_rating.split(' ')[-6], 'current_epc_efficiency': int(current_rating.split(' ')[-1]), @@ -163,6 +163,7 @@ def app(): collected_data.append( { **response, + "epc": property_data.to_dict(), "epc_directory": directory } )