overwrite solar and solar scenario storage to db instead of creating a new record

This commit is contained in:
Khalim Conn-Kowlessar 2024-09-18 12:23:33 +01:00
parent c693c6a633
commit ef6aad6425
2 changed files with 0 additions and 5 deletions

View file

@ -192,8 +192,6 @@ class GoogleSolarApi:
if not self.need_to_store:
return
logger.info("Storing to database")
scenarios_data = self.panel_performance.head(1)[
[
"n_panels",
@ -221,7 +219,6 @@ class GoogleSolarApi:
scenarios_data["scenario_type"] = scenario_type
scenarios_data = scenarios_data.to_dict(orient="records")
# TODO: Rather than just doing a straight insert, we should overwrite what's already there if it exists
store_batch_data(
session=session,
api_data=self.insights_data,

View file

@ -651,8 +651,6 @@ async def trigger_plan(body: PlanTriggerRequest):
)
# Store the data in the database
# TODO: Rather than just doing a straight insert, we should overwrite what's already there if it
# exists
solar_api_client.save_to_db(
session=session,
uprns_to_location=[