|
20 | 20 | from evidently.future.metric_types import CountCalculation
|
21 | 21 | from evidently.future.metric_types import CountMetric
|
22 | 22 | from evidently.future.metric_types import CountValue
|
| 23 | +from evidently.future.metric_types import MetricCalculationBase |
23 | 24 | from evidently.future.metric_types import MetricTest
|
24 | 25 | from evidently.future.metric_types import MetricTestProto
|
25 | 26 | from evidently.future.metric_types import MetricTestResult
|
|
28 | 29 | from evidently.future.metric_types import SingleValueMetric
|
29 | 30 | from evidently.future.metric_types import TestConfig
|
30 | 31 | from evidently.future.metric_types import TMetric
|
| 32 | +from evidently.future.metric_types import TResult |
31 | 33 | from evidently.future.metrics._legacy import LegacyMetricCalculation
|
32 | 34 | from evidently.future.report import Context
|
33 | 35 | from evidently.future.tests import Reference
|
@@ -400,6 +402,11 @@ class ValueDrift(ColumnMetric, SingleValueMetric):
|
400 | 402 | threshold: Optional[float] = None
|
401 | 403 |
|
402 | 404 |
|
| 405 | +class ValueDriftBoundTest(BoundTest[SingleValue]): |
| 406 | + def run_test(self, context: "Context", calculation: MetricCalculationBase[TResult], metric_result: TResult): |
| 407 | + raise NotImplementedError() |
| 408 | + |
| 409 | + |
403 | 410 | class ValueDriftTest(MetricTest):
|
404 | 411 | def to_test(self) -> MetricTestProto:
|
405 | 412 | raise NotImplementedError()
|
@@ -451,6 +458,10 @@ def calculate(self, context: "Context", current_data: Dataset, reference_data: O
|
451 | 458 | status=TestStatus.FAIL if drift.drift_detected else TestStatus.SUCCESS,
|
452 | 459 | metric_config=self.to_metric_config(),
|
453 | 460 | test_config={},
|
| 461 | + bound_test=ValueDriftBoundTest( |
| 462 | + test=ValueDriftTest(), |
| 463 | + metric_fingerprint=self.to_metric().metric_id, |
| 464 | + ), |
454 | 465 | )
|
455 | 466 | ]
|
456 | 467 | )
|
|
0 commit comments