Refactor error handling in Gates and OPC activities; update OPC_NAME to OPC_ID in values.yaml
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -63,7 +63,7 @@ class OPC(BaseActivity):
|
||||
level=NotificationLevel.ERROR,
|
||||
attachment_content=trace
|
||||
)
|
||||
self.logger.error(trace)
|
||||
raise e
|
||||
|
||||
@activity.defn(name='write_opc_data')
|
||||
async def write_opc_data(self, input_data: dict[str, Any]):
|
||||
|
||||
@@ -152,7 +152,7 @@ env:
|
||||
- name: MLFLOW_PASSWORD
|
||||
value: "aignosi"
|
||||
|
||||
- name: OPC_NAME
|
||||
- name: OPC_ID
|
||||
value: "server-1"
|
||||
- name: OPC_URL
|
||||
value: "opc.tcp://sientia-opc-simulator.sientia.svc.cluster.local:4840"
|
||||
|
||||
Reference in New Issue
Block a user