Skip to content

Commit e22f725

Browse files
committed
[validation.py] Throw String Dtype Warning Only If All Values Match Dtype
1 parent b5d8d09 commit e22f725

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

odml/validation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,9 @@ def property_values_string_check(prop):
431431

432432
res_dtype = max(set(val_dtypes), key=val_dtypes.count)
433433

434+
if len(set(val_dtypes)) > 1:
435+
res_dtype = "string"
436+
434437
if res_dtype != "string":
435438
msg = 'Dtype of property "%s" currently is "string", but might fit dtype "%s"!' % (prop.name, res_dtype)
436439
yield ValidationError(prop, msg, LABEL_WARNING)

0 commit comments

Comments
 (0)