From bb9b8308be2642e629e95d3fb1eee66e17100a59 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 2 Jan 2024 10:55:30 +0000 Subject: [PATCH] created test file for no epc --- etl/testing_data/no_epc_input.py | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 etl/testing_data/no_epc_input.py diff --git a/etl/testing_data/no_epc_input.py b/etl/testing_data/no_epc_input.py new file mode 100644 index 00000000..0745ff7a --- /dev/null +++ b/etl/testing_data/no_epc_input.py @@ -0,0 +1,42 @@ +""" +This script will create an input csv for the recommendation engine and upload it to S3, which can be used for +testing +""" +import pandas as pd +from utils.s3 import save_csv_to_s3 + +USER_ID = 8 +PORTFOLIO_ID = 57 + + +def app(): + """ + This portfolio is for testing windows recommendations + :return: + """ + + test_file = pd.DataFrame( + [ + {"address": "21 Butler House", "postcode": "E2 0PN", "Notes": None}, + {"address": "22 Butler House", "postcode": "E2 0PN", "Notes": None}, + {"address": "23 Butler House", "postcode": "E2 0PN", "Notes": None}, + {"address": "24 Butler House", "postcode": "E2 0PN", "Notes": None}, + ] + ) + + # Store the data in s3 + filename = f"{USER_ID}/{PORTFOLIO_ID}/no_epc.csv" + save_csv_to_s3( + dataframe=test_file, + bucket_name="retrofit-plan-inputs-dev", + file_name=filename + ) + + body = { + "portfolio_id": str(PORTFOLIO_ID), + "housing_type": "Social", + "goal": "Increase EPC", + "goal_value": "A", + "trigger_file_path": filename + } + print(body)