Refactor error handling in Gates and OPC activities; update OPC_NAME to OPC_ID in values.yaml

This commit is contained in:
vitor-aignosi
2025-06-11 17:55:27 -03:00
parent d57ecc3041
commit fc1cd056af
3 changed files with 7 additions and 4 deletions

View File

@@ -94,6 +94,7 @@ class Gates(BaseActivity):
level=NotificationLevel.ERROR,
attachment_content=trace
)
raise e
for path_flag in path_priority:
if path_flag in filter_output:
@@ -157,6 +158,7 @@ class Gates(BaseActivity):
level=NotificationLevel.ERROR,
attachment_content=trace
)
raise e
for path_flag in path_priority:
if path_flag in filter_output:
@@ -218,6 +220,7 @@ class Gates(BaseActivity):
level=NotificationLevel.ERROR,
attachment_content=trace
)
raise e
for path_flag in path_priority:
if path_flag in filter_output:
@@ -229,7 +232,7 @@ class Gates(BaseActivity):
return None, 0, ""
@activity.defn(name="format_prediction")
async def format_prediction(self, input_data: dict[str, Any]) -> dict[str, Any]:
async def format_prediction(self, input_data: dict[str, Any]) -> dict[Any, Any]:
"""
Formats the prediction data.
Args:
@@ -254,7 +257,7 @@ class Gates(BaseActivity):
return data.to_dict()
@activity.defn(name="format_default_prediction")
async def format_default_prediction(self, input_data: dict[str, Any]) -> dict[str, Any]:
async def format_default_prediction(self, input_data: dict[str, Any]) -> dict[Any, Any]:
"""
Creates and formats the default prediction data, with zero value in prediction,
and usefull information in the other fields.