SIENTIAPDE-1478
Update sientia-dataops-library dependency version from 1.8.1 to 1.8.2 in requirements.txt and modify API class to accept a list of response data for PI Web API integration.
This commit is contained in:
@@ -77,7 +77,7 @@ class API(SientiaMonitoring):
|
||||
|
||||
async def process_pi_web_api_response(
|
||||
self,
|
||||
response_data: dict[str, Any],
|
||||
response_data: list[dict[str, Any]],
|
||||
tags: dict[str, str],
|
||||
core_labels: dict[str, str],
|
||||
metadata: dict[str, Any],
|
||||
@@ -110,8 +110,7 @@ class API(SientiaMonitoring):
|
||||
|
||||
# Evaluate response for each tag
|
||||
written_tags = []
|
||||
response_items = response_data.get('Items', [])
|
||||
for item in response_items:
|
||||
for item in response_data:
|
||||
web_id = item.get('WebId')
|
||||
if not web_id:
|
||||
self.error('The response did not contain some WebIds', metadata)
|
||||
@@ -233,6 +232,8 @@ class API(SientiaMonitoring):
|
||||
attachment_content=trace,
|
||||
)
|
||||
|
||||
self.error(trace, metadata)
|
||||
|
||||
data['prediction_confidence'] = PI_WEB_API_PREDICTION_ERROR_CONFIDENCE
|
||||
data['comments'] = str(e)
|
||||
|
||||
@@ -266,4 +267,4 @@ class API(SientiaMonitoring):
|
||||
attachment_content=trace,
|
||||
)
|
||||
|
||||
return data.to_dict()
|
||||
return data.to_dict()
|
||||
Reference in New Issue
Block a user