Skip to content

Commit 2071304

Browse files
authored
Add support for smart_union in all metrics config. (#1513)
1 parent d79c37e commit 2071304

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/evidently/future/metric_types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,7 @@ class Metric(AutoAliasMixin, EvidentlyBaseModel, Generic[TCalculation]):
729729

730730
class Config:
731731
is_base_type = True
732+
smart_union = True
732733

733734
__calculation_type__: ClassVar[Type[TCalculation]]
734735

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from evidently.future.metrics import InRangeValueCount
2+
3+
4+
def test_in_range_metric():
5+
metric = InRangeValueCount(column="a", left=0.5, right=1)
6+
assert metric.left == 0.5
7+
assert metric.right == 1
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from evidently.future.metrics import OutRangeValueCount
2+
3+
4+
def test_out_range_metric():
5+
metric = OutRangeValueCount(column="a", left=0.5, right=1)
6+
assert metric.left == 0.5
7+
assert metric.right == 1

0 commit comments

Comments
 (0)