in pulsar/schema/definition.py [0:0]
def validate_type(self, name, val):
if val is None and not self._required:
return self.default()
if not isinstance(val, self.python_type()):
raise TypeError("Invalid type '%s' for field '%s'. Expected: %s" % (type(val), name, _string_representation(self.python_type())))
return val