Skip to content

Commit 8b6f221

Browse files
committed
fixed last test
1 parent 675fc09 commit 8b6f221

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

libs/labelbox/src/labelbox/data/annotation_types/metrics/scalar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ScalarMetric(BaseMetric):
3131
"""
3232
metric_name: Optional[str] = None
3333
value: Union[ScalarMetricValue, ScalarMetricConfidenceValue]
34-
aggregation: ScalarMetricAggregation = ScalarMetricAggregation.ARITHMETIC_MEAN
34+
aggregation: ScalarMetricAggregation = ScalarMetricAggregation.ARITHMETIC_MEAN.value
3535

3636
@field_validator('metric_name')
3737
def validate_metric_name(cls, name: Union[str, None]):

libs/labelbox/tests/data/annotation_types/test_metrics.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ def test_legacy_scalar_metric():
1919
'uid': 'ckrmd9q8g000009mg6vej7hzg',
2020
},
2121
'annotations': [{
22+
'aggregation': 'ARITHMETIC_MEAN',
2223
'value': 10.0,
2324
'extra': {},
2425
}],
2526
'extra': {},
2627
}
28+
from pprint import pprint
29+
pprint(label.model_dump(exclude_none=True))
30+
pprint(expected)
2731
assert label.model_dump(exclude_none=True) == expected
2832

2933

0 commit comments

Comments
 (0)