File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
libs/labelbox/src/labelbox/data/serialization/ndjson Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,20 @@ def _create_non_video_annotations(cls, label: Label):
188188 def _create_relationship_annotations (
189189 cls , label : Label
190190 ) -> Generator [NDRelationship , None , None ]:
191+ """Creates relationship annotations following validation rules for source and target types.
192+
193+ Args:
194+ label: Label containing relationship annotations to be processed
195+
196+ Yields:
197+ NDRelationship: Validated relationship annotations in NDJSON format
198+
199+ Raises:
200+ TypeError: If source/target types violate the validation rules:
201+ - Invalid source type for PDF target
202+ - Non-ObjectAnnotation source for non-PDF target
203+ - Non-ObjectAnnotation target
204+ """
191205 for annotation in label .annotations :
192206 if isinstance (annotation , RelationshipAnnotation ):
193207 uuid1 = uuid4 ()
You can’t perform that action at this time.
0 commit comments