We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79953ea commit 2f0c4ebCopy full SHA for 2f0c4eb
python/model/base.py
@@ -163,9 +163,12 @@ def _validate(self, input):
163
var_type = float
164
elif var_type == 'string':
165
var_type = str
166
- elif (var_type == 'category') and (categories is not None):
167
- var_type = CategoricalDtype(categories=categories,
168
- ordered=True)
+ elif var_type == 'category':
+ if categories is not None:
+ var_type = CategoricalDtype(categories=categories, ordered=True)
169
+ else:
170
+ msg = 'Missing "categories" for "{}" in metadata'.format(name)
171
+ raise ValueError(msg)
172
else:
173
msg = 'Unknown variable type: {}'.format(var_type)
174
raise ValueError(msg)
0 commit comments