From 0bb7e139ac63c36909ab03b7cc2248e65d264427 Mon Sep 17 00:00:00 2001 From: John Wilkie <124276291+JBWilkie@users.noreply.github.com> Date: Fri, 11 Oct 2024 10:01:36 +0100 Subject: [PATCH] Skip item-properties import for non-Darwin JSON formats (#939) --- darwin/importer/importer.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/darwin/importer/importer.py b/darwin/importer/importer.py index 21de45e2e..118cae2bc 100644 --- a/darwin/importer/importer.py +++ b/darwin/importer/importer.py @@ -962,10 +962,11 @@ def _normalize_item_properties( return item_properties normalized_properties = defaultdict(lambda: {"property_values": []}) - for item_prop in item_properties: - name = item_prop["name"] - value = item_prop["value"] - normalized_properties[name]["property_values"].append({"value": value}) + if item_properties: + for item_prop in item_properties: + name = item_prop["name"] + value = item_prop["value"] + normalized_properties[name]["property_values"].append({"value": value}) return normalized_properties