Skip to content

Commit 3963cf9

Browse files
authored
Merge pull request #278 from VariantEffect/estelle/debugStatisticsRecord
Debug statistics record score-set and keywords problem.
2 parents d9582a1 + b05b4da commit 3963cf9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/mavedb/routers/statistics.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,11 @@ def record_object_statistics(
332332
Model names and fields should be members of the Enum classes defined above. Providing an invalid model name or
333333
model field will yield a 422 Unprocessable Entity error with details about valid enum values.
334334
"""
335+
# Validation to ensure 'keywords' is only used with 'experiment'.
336+
if model == RecordNames.scoreSet and field == RecordFields.keywords:
337+
raise HTTPException(status_code=422,
338+
detail="The 'keywords' field can only be used with the 'experiment' model.")
339+
335340
count_data = _record_from_field_and_model(db, model, field)
336341

337342
return {field_val: count for field_val, count in count_data if field_val is not None}

0 commit comments

Comments
 (0)