File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
src/labelbox/data/annotation_types/metrics
tests/data/annotation_types Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class ScalarMetric(BaseMetric):
31
31
"""
32
32
metric_name : Optional [str ] = None
33
33
value : Union [ScalarMetricValue , ScalarMetricConfidenceValue ]
34
- aggregation : ScalarMetricAggregation = ScalarMetricAggregation .ARITHMETIC_MEAN
34
+ aggregation : ScalarMetricAggregation = ScalarMetricAggregation .ARITHMETIC_MEAN . value
35
35
36
36
@field_validator ('metric_name' )
37
37
def validate_metric_name (cls , name : Union [str , None ]):
Original file line number Diff line number Diff line change @@ -19,11 +19,15 @@ def test_legacy_scalar_metric():
19
19
'uid' : 'ckrmd9q8g000009mg6vej7hzg' ,
20
20
},
21
21
'annotations' : [{
22
+ 'aggregation' : 'ARITHMETIC_MEAN' ,
22
23
'value' : 10.0 ,
23
24
'extra' : {},
24
25
}],
25
26
'extra' : {},
26
27
}
28
+ from pprint import pprint
29
+ pprint (label .model_dump (exclude_none = True ))
30
+ pprint (expected )
27
31
assert label .model_dump (exclude_none = True ) == expected
28
32
29
33
You can’t perform that action at this time.
0 commit comments