From fc1468efdac13a9331f64d7785917a7759b46b0c Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 1 Oct 2024 16:31:18 +0100 Subject: [PATCH] enforcing datetime is string --- etl/bill_savings/KwhData.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etl/bill_savings/KwhData.py b/etl/bill_savings/KwhData.py index 6b5f594a..24ce9f2c 100644 --- a/etl/bill_savings/KwhData.py +++ b/etl/bill_savings/KwhData.py @@ -259,6 +259,9 @@ class KwhData: # Create new features: data['estimate_annual_kwh'] = data['energy-consumption-current'] * data['total-floor-area'] + # Ensure this is string, because we could have mixed types + data["lodgement-datetime"] = data["lodgement-datetime"].astype(str) + if save: self.model_training_data_filepath = f"energy_consumption/{self.run_date}/training_data.parquet" logger.info(f"Storing energy consumption dataset in s3 at {self.consumption_data_filepath}")