Skip to content

Commit

Permalink
Add a comment to create_relationship_annotations function
Browse files Browse the repository at this point in the history
  • Loading branch information
lgluszek committed Dec 18, 2024
1 parent e4a9628 commit ac91670
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions libs/labelbox/src/labelbox/data/serialization/ndjson/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,20 @@ def _create_non_video_annotations(cls, label: Label):
def _create_relationship_annotations(
cls, label: Label
) -> Generator[NDRelationship, None, None]:
"""Creates relationship annotations following validation rules for source and target types.
Args:
label: Label containing relationship annotations to be processed
Yields:
NDRelationship: Validated relationship annotations in NDJSON format
Raises:
TypeError: If source/target types violate the validation rules:
- Invalid source type for PDF target
- Non-ObjectAnnotation source for non-PDF target
- Non-ObjectAnnotation target
"""
for annotation in label.annotations:
if isinstance(annotation, RelationshipAnnotation):
uuid1 = uuid4()
Expand Down

0 comments on commit ac91670

Please sign in to comment.