Skip to content

Commit aa99894

Browse files
committed
AL-3578: Fixed attr access
1 parent da01e92 commit aa99894

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

labelbox/schema/confidence_presence_checker.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@ def _check_annotation(cls, annotation: Union[ClassificationAnnotation,
3434
ScalarMetric,
3535
ConfusionMatrixMetric]):
3636

37-
confidence: Union[float, None] = getattr(annotation, 'confidence')
37+
confidence: Union[float,
38+
None] = getattr(annotation, 'confidence') if hasattr(
39+
annotation, 'confidence') else None
3840
if confidence is not None:
3941
return True
4042

41-
classifications: Union[List[ClassificationAnnotation],
42-
None] = getattr(annotation, 'classifications')
43+
classifications: Union[List[ClassificationAnnotation], None] = getattr(
44+
annotation, 'classifications') if hasattr(
45+
annotation, 'classifications') else None
4346
if classifications:
4447
return any([cls._check_classification(x) for x in classifications])
4548
return False

0 commit comments

Comments
 (0)