def validate_type()

in pulsar/schema/definition.py [0:0]


    def validate_type(self, name, val):
        t = type(val)

        if val is None and not self._required:
            return self.default()

        if not (t is str or t.__name__ == 'unicode'):
            raise TypeError("Invalid type '%s' for field '%s'. Expected a string" % (t, name))
        return val