File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments