Skip to content

Commit 26900c0

Browse files
authored
Merge branch 'main' into ODSC-64668/report_misformat
2 parents 177a71c + 8d358c7 commit 26900c0

File tree

7 files changed

+42
-3
lines changed

7 files changed

+42
-3
lines changed

ads/aqua/common/decorator.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ def inner_function(
6969
reason=error.message,
7070
service_payload=error.args[0] if error.args else None,
7171
exc_info=sys.exc_info(),
72+
aqua_api_details=dict(
73+
# __qualname__ gives information of class and name of api
74+
aqua_api_name=func.__qualname__,
75+
oci_api_name=getattr(
76+
error, "operation_name", "Unknown OCI Operation"
77+
),
78+
service_endpoint=getattr(
79+
error, "request_endpoint", "Unknown Request Endpoint"
80+
)
81+
)
7282
)
7383
except (
7484
ClientError,

ads/aqua/evaluation/entities.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
This module contains dataclasses for aqua evaluation.
1010
"""
1111

12+
from typing import Any, Dict, List, Optional
13+
1214
from pydantic import Field
13-
from typing import Any, Dict, List, Optional, Union
1415

15-
from ads.aqua.data import AquaResourceIdentifier
1616
from ads.aqua.config.utils.serializer import Serializable
17+
from ads.aqua.data import AquaResourceIdentifier
1718

1819

1920
class CreateAquaEvaluationDetails(Serializable):
@@ -87,6 +88,8 @@ class CreateAquaEvaluationDetails(Serializable):
8788

8889
class Config:
8990
extra = "ignore"
91+
protected_namespaces = ()
92+
9093

9194
class AquaEvalReport(Serializable):
9295
evaluation_id: str = ""
@@ -95,6 +98,7 @@ class AquaEvalReport(Serializable):
9598
class Config:
9699
extra = "ignore"
97100

101+
98102
class AquaEvalParams(Serializable):
99103
shape: str = ""
100104
dataset_path: str = ""
@@ -103,6 +107,7 @@ class AquaEvalParams(Serializable):
103107
class Config:
104108
extra = "allow"
105109

110+
106111
class AquaEvalMetric(Serializable):
107112
key: str
108113
name: str
@@ -111,6 +116,7 @@ class AquaEvalMetric(Serializable):
111116
class Config:
112117
extra = "ignore"
113118

119+
114120
class AquaEvalMetricSummary(Serializable):
115121
metric: str = ""
116122
score: str = ""
@@ -119,6 +125,7 @@ class AquaEvalMetricSummary(Serializable):
119125
class Config:
120126
extra = "ignore"
121127

128+
122129
class AquaEvalMetrics(Serializable):
123130
id: str
124131
report: str
@@ -128,6 +135,7 @@ class AquaEvalMetrics(Serializable):
128135
class Config:
129136
extra = "ignore"
130137

138+
131139
class AquaEvaluationCommands(Serializable):
132140
evaluation_id: str
133141
evaluation_target_id: str
@@ -139,6 +147,7 @@ class AquaEvaluationCommands(Serializable):
139147
class Config:
140148
extra = "ignore"
141149

150+
142151
class AquaEvaluationSummary(Serializable):
143152
"""Represents a summary of Aqua evalution."""
144153

@@ -157,6 +166,7 @@ class AquaEvaluationSummary(Serializable):
157166
class Config:
158167
extra = "ignore"
159168

169+
160170
class AquaEvaluationDetail(AquaEvaluationSummary):
161171
"""Represents a details of Aqua evalution."""
162172

ads/aqua/extension/aqua_ws_msg_handler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@ def write_error(self, status_code, **kwargs):
7878
logger.warning(reply["message"])
7979
# telemetry may not be present if there is an error while initializing
8080
if hasattr(self, "telemetry"):
81+
aqua_api_details = kwargs.get("aqua_api_details", {})
8182
self.telemetry.record_event_async(
8283
category="aqua/error",
8384
action=str(status_code),
8485
value=reason,
86+
**aqua_api_details
8587
)
8688
response = AquaWsError(
8789
status=status_code,

ads/aqua/extension/base_handler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,12 @@ def write_error(self, status_code, **kwargs):
9898

9999
# telemetry may not be present if there is an error while initializing
100100
if hasattr(self, "telemetry"):
101+
aqua_api_details = kwargs.get("aqua_api_details", {})
101102
self.telemetry.record_event_async(
102103
category="aqua/error",
103104
action=str(status_code),
104105
value=reason,
106+
**aqua_api_details
105107
)
106108

107109
self.finish(json.dumps(reply))

docs/source/release_notes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
Release Notes
33
=============
44

5+
2.12.6
6+
-------
7+
Release date: November 12, 2024
8+
9+
* Support using environment variable to override AI Quick Actions Fine Tuning container image.
10+
* Adding metadata in telemetry error logging for AI Quick Actions.
11+
12+
513
2.12.5
614
-------
715
Release date: November 10, 2024

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ build-backend = "flit_core.buildapi"
2121

2222
# Required
2323
name = "oracle_ads" # the install (PyPI) name; name for local build in [tool.flit.module] section below
24-
version = "2.12.5"
24+
version = "2.12.6"
2525

2626
# Optional
2727
description = "Oracle Accelerated Data Science SDK"

tests/unitary/with_extras/aqua/test_handlers.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ def test_finish(self, name, payload, expected_call, mock_super_finish):
129129
),
130130
None,
131131
),
132+
aqua_api_details=dict(
133+
aqua_api_name="TestDataset.create",
134+
oci_api_name=TestDataset.mock_service_payload_create["operation_name"],
135+
service_endpoint=TestDataset.mock_service_payload_create["request_endpoint"]
136+
)
132137
),
133138
"Authorization Failed: The resource you're looking for isn't accessible. Operation Name: get_job_run.",
134139
],
@@ -159,12 +164,14 @@ def test_write_error(self, name, input, expected_msg, mock_uuid, mock_logger):
159164
"request_id": "1234",
160165
}
161166
self.test_instance.finish.assert_called_once_with(json.dumps(expected_reply))
167+
aqua_api_details = input.get("aqua_api_details", {})
162168
self.test_instance.telemetry.record_event_async.assert_called_with(
163169
category="aqua/error",
164170
action=str(
165171
input.get("status_code"),
166172
),
167173
value=input.get("reason"),
174+
**aqua_api_details
168175
)
169176

170177
mock_logger.warning.assert_called_with(expected_msg)

0 commit comments

Comments
 (0)