SIENTIAPDE-1314

SIENTIAPDE-1314 Refactor OPC Write Operation in FormatAndExportPrediction Workflow

- Changed the variable name for the result of the OPC write operation for clarity.
- Extracted prediction and metrics from the OPC write result to improve data handling.
This commit is contained in:
vitor-aignosi
2025-10-24 10:22:48 -03:00
parent 723b30b1d6
commit 4b9da16aa6

View File

@@ -269,7 +269,7 @@ class OPC(BaseActivity):
return success, response_times
@activity.defn(name='write_opc_data')
async def write_opc_data(self, input_data: dict[str, Any]) -> dict[Any, Any]:
async def write_opc_data(self, input_data: dict[str, Any]) -> tuple[dict[Any, Any], dict[str, dict[str, float | None]]]:
"""
Write prediction and confidence data to OPC servers. The two writing
operations are optional and independent of each other.
@@ -314,10 +314,7 @@ class OPC(BaseActivity):
metadata,
)
return {
'data': self.process_confidence(data, success, metadata),
'metrics': metrics,
}
return self.process_confidence(data, success, metadata), metrics
def process_confidence(
self, data: DataFrame, success: bool, metadata: dict[str, Any]