Skip to content

Commit

Permalink
RE: skip create/update properties with null value
Browse files Browse the repository at this point in the history
  • Loading branch information
saurbhc committed Jan 29, 2024
1 parent 62f1e00 commit 2bfb416
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion darwin/importer/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ def _import_properties(
full_property.property_values = []

property_values = full_property.property_values
if a_prop.value is None:
# skip creating property if property value is None
continue
# find property value in m_prop (.v7/metadata.json) options
for m_prop_option in m_prop_options:
if m_prop_option.get("value") == a_prop.value:
Expand All @@ -436,6 +439,9 @@ def _import_properties(
break
else:
property_values = []
if a_prop.value is None:
# skip creating property if property value is None
continue
# find property value in m_prop (.v7/metadata.json) options
for m_prop_option in m_prop_options:
if m_prop_option.get("value") == a_prop.value:
Expand Down Expand Up @@ -496,7 +502,7 @@ def _import_properties(
annotation_class_id=int(annotation_class_id),
property_values=[
PropertyValue(
value=m_prop_option.get("value"), # type: ignore
value=a_prop.value,
color=m_prop_option.get("color"), # type: ignore
)
],
Expand Down

0 comments on commit 2bfb416

Please sign in to comment.