From 0a3b827be276f2227bb772bf8a57930decca0bfa Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 23 Jun 2026 10:33:38 +0000 Subject: [PATCH 1/2] task handler returns task and subtask IDs --- utilities/aws_lambda/task_handler.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/utilities/aws_lambda/task_handler.py b/utilities/aws_lambda/task_handler.py index 093d6bd6..34811515 100644 --- a/utilities/aws_lambda/task_handler.py +++ b/utilities/aws_lambda/task_handler.py @@ -42,7 +42,7 @@ def task_handler( @wraps(func) def wrapper(event: dict[str, Any], context: Any) -> Any: with factory() as orchestrator: - results: list[Any] = [] + task_ids: list[dict[str, str]] = [] failures: list[dict[str, Any]] = [] for record in _records(event): @@ -52,19 +52,21 @@ def task_handler( str(raw_source_id) if raw_source_id is not None else None ) - _, subtask = orchestrator.create_task_with_subtask( + task, subtask = orchestrator.create_task_with_subtask( task_source=task_source, inputs=body, source=source, source_id=source_id, ) + task_ids.append( + {"task_id": str(task.id), "subtask_id": str(subtask.id)} + ) try: - result = orchestrator.run_subtask( + orchestrator.run_subtask( subtask.id, work=lambda body=body: func(body, context), ) - results.append(result) except Exception: logger.exception( "subtask failed (task_source=%s source_id=%s)", @@ -78,8 +80,8 @@ def task_handler( raise if "Records" in event: - return {"batchItemFailures": failures} - return results + return {"batchItemFailures": failures, "tasks": task_ids} + return task_ids return wrapper From c49e1f60a277baa3d3df6dd845b14edc0ee77679 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 23 Jun 2026 10:36:27 +0000 Subject: [PATCH 2/2] dont consider system tune up recommendations - causes error --- applications/modelling_e2e/handler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/applications/modelling_e2e/handler.py b/applications/modelling_e2e/handler.py index d45951e3..2a02d8b2 100644 --- a/applications/modelling_e2e/handler.py +++ b/applications/modelling_e2e/handler.py @@ -284,10 +284,12 @@ def handler(body: dict[str, Any], context: Any) -> None: # secondary_heating_removal is absent from the live material.type # enum; exclude unconditionally until the catalogue gap is resolved. + # system_tune_up and system_tune_up_zoned have no active product. considered: Optional[frozenset[MeasureType]] = ( frozenset(MeasureType) - {MeasureType.SECONDARY_HEATING_REMOVAL} - {MeasureType.SYSTEM_TUNE_UP_ZONED} + - {MeasureType.SYSTEM_TUNE_UP} ) plan = run_modelling(