Skip to content

Commit 0774fb7

Browse files
committed
Fail at seeding time if bridge configuration is invalid.
Detect at seeding time whether a bridge is referring to a source SSSOM set that is not defined, and error out immediately.
1 parent f66b115 commit 0774fb7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

odk/odk.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,12 +576,18 @@ def _add_stub(self, id):
576576

577577
def _derive_fields(self, project):
578578
for product in [p for p in self.products if p.bridge_type == "sssom"]:
579+
if project.sssom_mappingset_group is None:
580+
raise Exception("The project defines a SSSOM-derived bridge but has no SSSOM group")
581+
579582
if product.sources is None:
580583
# Default source is a mapping set with the same name as
581584
# the bridge itself
582-
# FIXME: we do not check that such a mapping set exists!
583585
product.sources = [product.id]
584586

587+
for source in product.sources:
588+
if source not in [p.id for p in project.sssom_mappingset_group.products]:
589+
raise Exception(f"Missing source SSSOM set '{source}' for bridge '{product.id}'")
590+
585591
@dataclass_json
586592
@dataclass
587593
class BabelonTranslationSetGroup(JsonSchemaMixin):

0 commit comments

Comments
 (0)