Skip to content

Commit d447e84

Browse files
authored
Merge pull request #26 from sensein/claude/schema-registry-meta-model-2upt56
Fix test_undefined_slot_raises: only swallow missing-parent-class errors
2 parents fd9076d + 20123a8 commit d447e84

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

neuro_ghost/ingest_linkml.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,13 @@ def parse_linkml(path: Path) -> dict[str, Any]:
252252

253253
try:
254254
induced_slots = sv.class_induced_slots(cls_name)
255-
except (ValueError, KeyError):
256-
# is_a points to a class outside this schema (e.g. NWB's "Container")
257-
# Fall back to directly-declared slots only.
255+
except (ValueError, KeyError) as exc:
256+
msg = str(exc)
257+
# Only tolerate "No such class" — that means is_a points outside
258+
# this schema (e.g. NWB's NWBContainer → Container). A missing
259+
# slot is a genuine schema error; re-raise so the caller sees it.
260+
if "No such class" not in msg:
261+
raise
258262
induced_slots = list(cls_def.attributes.values())
259263
for sname in (cls_def.slots or []):
260264
try:

0 commit comments

Comments
 (0)