From 4b4992e8994ad509dae7e348b8312c3156c6ac3d Mon Sep 17 00:00:00 2001 From: Oliver Schmid Date: Mon, 19 Aug 2024 14:26:51 +0200 Subject: [PATCH] Update instance.py --- pipeline/instance.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pipeline/instance.py b/pipeline/instance.py index a86fc900..aed3fd4f 100644 --- a/pipeline/instance.py +++ b/pipeline/instance.py @@ -83,6 +83,8 @@ def _build_multi_instance_links(self, instanceReferenceList:List) -> str: def _build_instance_library_link(self, instanceReferenceList:List[Dict]) -> str: # this function assumes that all instances in list have the same type + if "@id" not in instanceReferenceList[0]: + raise ValueError(f"Was not able to find id of instance {json.dumps(instanceReferenceList[0], indent=2)}") instance_example_id = instanceReferenceList[0]["@id"] instance_example_type = instance_example_id.split("/")[4] instance_type_plural = self._build_plurals(instance_example_type)