Skip to content

Commit

Permalink
update build_list_properties fn - convert to a simple list comprehension
Browse files Browse the repository at this point in the history
  • Loading branch information
saurbhc committed Dec 13, 2023
1 parent d3a3548 commit 5ecbd0b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions darwin/importer/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Union,
)

from darwin.datatypes import AnnotationFile, PropertyClass
from darwin.datatypes import AnnotationFile
from darwin.future.data_objects.properties import FullProperty, SelectedProperty
from darwin.item import DatasetItem

Expand Down Expand Up @@ -269,12 +269,7 @@ def _resolve_annotation_classes(


def build_list_properties(annotations: List[dt.Annotation]) -> List[SelectedProperty]:
selected_properties: List[SelectedProperty] = []
for annotation in annotations:
for prop in annotation.properties or []:
selected_properties.append(prop)

return selected_properties
return [prop for annotation in annotations for prop in annotation.properties or []]


def properties_missing(
Expand Down

0 comments on commit 5ecbd0b

Please sign in to comment.