Skip to content

Commit

Permalink
Merge pull request #441 from jklaise/bool_python_bug
Browse files Browse the repository at this point in the history
Fix bug in parsing boolean params in Python wrapper
  • Loading branch information
jklaise authored Feb 13, 2019
2 parents 81dd36a + d11ad08 commit 57bbb19
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/seldon_core/microservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from google.protobuf import json_format
from google.protobuf.struct_pb2 import ListValue
import sys
from distutils.util import strtobool

from seldon_core.proto import prediction_pb2
import seldon_core.persistence as persistence
Expand Down Expand Up @@ -243,7 +244,10 @@ def parse_parameters(parameters):
name = param.get("name")
value = param.get("value")
type_ = param.get("type")
parsed_parameters[name] = type_dict[type_](value)
if type_ == "BOOL":
parsed_parameters[name] = bool(strtobool(value))
else:
parsed_parameters[name] = type_dict[type_](value)
return parsed_parameters


Expand Down

0 comments on commit 57bbb19

Please sign in to comment.