Only use unicode type in OmniScalar if six.PY2

This commit is contained in:
James Boehmer 2016-11-12 13:20:22 -05:00
parent 98f20fe52b
commit cae40be453

View File

@ -175,12 +175,14 @@ class OmniScalar(Scalar):
_scalar_type_map = { _scalar_type_map = {
str: String, str: String,
unicode: String,
bool: Boolean, bool: Boolean,
int: Int, int: Int,
float: Float, float: Float,
} }
if six.PY2:
_scalar_type_map[unicode] = String
@staticmethod @staticmethod
def serialize(value): def serialize(value):
scalar_type = OmniScalar._scalar_type_map.get(type(value)) scalar_type = OmniScalar._scalar_type_map.get(type(value))