Skip to content

Commit

Permalink
#3287: dataset.py, ensure python 2+3 string compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff1evesque committed Oct 9, 2018
1 parent 64d5c9e commit 4c6c0ec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions brain/validator/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from voluptuous import Schema, Required, All, Any, Length
from voluptuous.humanize import validate_with_humanized_errors
from six import string_types


class Validator(object):
Expand Down Expand Up @@ -38,9 +39,9 @@ def validate_classification(self, data):

current_errors = []
schema = Schema({
Required('dependent-variable'): All(unicode, Length(min=1)),
Required('dependent-variable'): All(string_types, Length(min=1)),
Required('independent-variables'): [{
Required(All(unicode, Length(min=1))): Any(int, float),
Required(All(string_types, Length(min=1))): Any(int, float),
}],
})

Expand Down Expand Up @@ -69,7 +70,7 @@ def validate_regression(self, data):
schema = Schema({
Required('dependent-variable'): Any(int, float),
Required('independent-variables'): [{
Required(All(unicode, Length(min=1))): Any(int, float),
Required(All(string_types, Length(min=1))): Any(int, float),
}],
})

Expand Down

0 comments on commit 4c6c0ec

Please sign in to comment.