Skip to content

Commit b2c66cb

Browse files
authored
review changes (#34480)
1 parent 404b60e commit b2c66cb

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/compute.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(
2626
self.instance_type = instance_type
2727

2828
def _to_rest_object(self) -> MonitorServerlessSparkCompute:
29-
self.validate()
29+
self._validate()
3030
return MonitorServerlessSparkCompute(
3131
runtime_version=self.runtime_version,
3232
instance_type=self.instance_type,
@@ -42,7 +42,7 @@ def _from_rest_object(cls, obj: MonitorServerlessSparkCompute) -> "ServerlessSpa
4242
instance_type=obj.instance_type,
4343
)
4444

45-
def validate(self) -> None:
45+
def _validate(self) -> None:
4646
if self.runtime_version != "3.3":
4747
msg = "Compute runtime version must be 3.3"
4848
err = ValidationException(

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/thresholds.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@ def _get_default_thresholds(cls) -> "NumericalDriftMetrics":
108108
def defaults(cls) -> "NumericalDriftMetrics":
109109
return cls._get_default_thresholds()
110110

111-
def get_name_and_threshold(self) -> Tuple:
112-
return self._find_name_and_threshold()
113-
114111

115112
class CategoricalDriftMetrics(RestTranslatableMixin):
116113
"""Categorical Drift Metrics
@@ -204,15 +201,15 @@ def __init__(
204201
def _to_rest_object(self) -> DataDriftMetricThresholdBase:
205202
thresholds = []
206203
if self.numerical:
207-
num_metric_name, num_threshold = self.numerical.get_name_and_threshold()
204+
num_metric_name, num_threshold = self.numerical._find_name_and_threshold()
208205
thresholds.append(
209206
NumericalDataDriftMetricThreshold(
210207
metric=snake_to_camel(num_metric_name),
211208
threshold=num_threshold,
212209
)
213210
)
214211
if self.categorical:
215-
cat_metric_name, cat_threshold = self.categorical.get_name_and_threshold()
212+
cat_metric_name, cat_threshold = self.categorical._find_name_and_threshold()
216213
thresholds.append(
217214
CategoricalDataDriftMetricThreshold(
218215
metric=snake_to_camel(cat_metric_name),
@@ -279,15 +276,15 @@ def __init__(
279276
def _to_rest_object(self) -> PredictionDriftMetricThresholdBase:
280277
thresholds = []
281278
if self.numerical:
282-
num_metric_name, num_threshold = self.numerical.get_name_and_threshold()
279+
num_metric_name, num_threshold = self.numerical._find_name_and_threshold()
283280
thresholds.append(
284281
NumericalPredictionDriftMetricThreshold(
285282
metric=snake_to_camel(num_metric_name),
286283
threshold=num_threshold,
287284
)
288285
)
289286
if self.categorical:
290-
cat_metric_name, cat_threshold = self.categorical.get_name_and_threshold()
287+
cat_metric_name, cat_threshold = self.categorical._find_name_and_threshold()
291288
thresholds.append(
292289
CategoricalPredictionDriftMetricThreshold(
293290
metric=snake_to_camel(cat_metric_name),
@@ -404,10 +401,6 @@ def _get_default_thresholds(cls) -> "DataQualityMetricsNumerical":
404401
out_of_bounds_rate=0.0,
405402
)
406403

407-
@classmethod
408-
def defaults(cls) -> "DataQualityMetricsNumerical":
409-
return cls._get_default_thresholds()
410-
411404

412405
class DataQualityMetricsCategorical(RestTranslatableMixin):
413406
"""Data Quality Categorical Metrics
@@ -480,10 +473,6 @@ def _get_default_thresholds(cls) -> "DataQualityMetricsCategorical":
480473
out_of_bounds_rate=0.0,
481474
)
482475

483-
@classmethod
484-
def defaults(cls) -> "DataQualityMetricsCategorical":
485-
return cls._get_default_thresholds()
486-
487476

488477
class DataQualityMetricThreshold(MetricThreshold):
489478
"""Data quality metric threshold

0 commit comments

Comments
 (0)