Skip to content

Commit f8e55e0

Browse files
committed
Add input check to CategoricalHyperparameterSettings.set_values
1 parent 5fb3518 commit f8e55e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dataikuapi/dss/ml.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,9 +817,11 @@ def set_values(self, values):
817817
"""
818818
Enables the search over listed values (categories).
819819
820-
:param values: values to enable, all other values will be disabled
820+
:param values: list of values to enable, all other values will be disabled
821821
:type values: list of str
822822
"""
823+
assert isinstance(values, list) and not isinstance(values, string_types), \
824+
"Invalid input type {} for categorical hyperparameter {}: must be a list of strings".format(type(values), self.name)
823825
all_possible_values = self.get_all_possible_values()
824826
for category in values:
825827
assert isinstance(category, string_types), \

0 commit comments

Comments
 (0)