mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Merge pull request #930 from Hestia-Homes/feature/ara-rebaselining
fixing property.property and passing task id
This commit is contained in:
commit
d43f6dd50b
4 changed files with 18 additions and 8 deletions
|
|
@ -174,6 +174,8 @@ async def trigger_plan_entrypoint(body: PlanTriggerRequest):
|
|||
service="plan_engine",
|
||||
inputs=data,
|
||||
task_only=True,
|
||||
source=SourceEnum.PORTFOLIO,
|
||||
source_id=str(body.portfolio_id),
|
||||
)
|
||||
|
||||
subtask_interface = SubTaskInterface()
|
||||
|
|
@ -222,6 +224,8 @@ async def trigger_plan_entrypoint(body: PlanTriggerRequest):
|
|||
service="plan_engine",
|
||||
inputs=data,
|
||||
task_only=False,
|
||||
source=SourceEnum.PORTFOLIO,
|
||||
source_id=str(body.portfolio_id),
|
||||
)
|
||||
data["task_id"] = str(task_id)
|
||||
data["subtask_id"] = str(subtask_id)
|
||||
|
|
|
|||
|
|
@ -134,10 +134,18 @@ def handler(event: Mapping[str, Any], context: Optional[Any]) -> Mapping[str, Un
|
|||
body_dict = {
|
||||
"task_id": "test",
|
||||
"subtask_id": "test",
|
||||
"portfolio_id": 569,
|
||||
"portfolio_id": 655,
|
||||
"scenario_ids": [],
|
||||
"default_plans_only": True,
|
||||
}
|
||||
|
||||
body_dict = {
|
||||
"task_id": "test",
|
||||
"subtask_id": "test",
|
||||
"portfolio_id": 655,
|
||||
"scenario_ids": [1174],
|
||||
"default_plans_only": False,
|
||||
}
|
||||
:param event: Lambda event containing export request details
|
||||
:param context: Lambda context (not used in this handler but included for completeness)
|
||||
:return: HTTP response indicating success or failure of the export operation
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@ import os
|
|||
import pickle
|
||||
import pandas as pd
|
||||
import pytest
|
||||
from datetime import datetime
|
||||
from backend.ml_models.api import ModelApi
|
||||
from backend.app.utils import sap_to_epc
|
||||
from backend.app.config import get_prediction_buckets
|
||||
|
||||
|
||||
def load_sample_certificates():
|
||||
|
|
@ -60,12 +64,6 @@ def load_cleaning_data():
|
|||
|
||||
@pytest.mark.integration
|
||||
def test_rebaselining_pipeline_with_real_data():
|
||||
import pandas as pd
|
||||
from datetime import datetime
|
||||
from backend.ml_models.api import ModelApi
|
||||
from backend.app.utils import sap_to_epc
|
||||
from backend.app.config import get_prediction_buckets
|
||||
|
||||
df = load_sample_certificates()
|
||||
cleaning_data = load_cleaning_data()
|
||||
input_properties = [make_property_from_row(row, cleaning_data=cleaning_data) for _, row in df.iterrows()]
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ class Costs:
|
|||
# Try and get the region after converting the keys to lower
|
||||
self.region = {
|
||||
k.lower(): v for k, v in county_to_region_map.items()
|
||||
}.get(self.property.property.epc_record.local_authority_label.lower(), None)
|
||||
}.get(self.property.epc_record.local_authority_label.lower(), None)
|
||||
|
||||
if self.region is None:
|
||||
logger.warning("No region found for county %s, defaulting to South East England",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue