Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions labelbox/data/ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ def get_feature_schema_lookup(

def flatten_classification(classifications):
for classification in classifications:
if classification.feature_schema_id is None:
raise ValueError(
f"feature_schema_id cannot be None for classification `{classification.name}`."
)
if isinstance(classification, ontology.Classification):
classification_lookup[
classification.
Expand All @@ -28,6 +32,9 @@ def flatten_classification(classifications):
flatten_classification(classification.options)

for tool in ontology_builder.tools:
if tool.feature_schema_id is None:
raise ValueError(
f"feature_schema_id cannot be None for tool `{tool.name}`.")
tool_lookup[tool.name] = tool.feature_schema_id
flatten_classification(tool.classifications)
flatten_classification(ontology_builder.classifications)
Expand Down