MCPcopy Index your code
hub / github.com/apache/cassandra-python-driver / validate

Method validate

cassandra/cqlengine/columns.py:703–710  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

701
702class BaseFloat(Column):
703 def validate(self, value):
704 value = super(BaseFloat, self).validate(value)
705 if value is None:
706 return
707 try:
708 return float(value)
709 except (TypeError, ValueError):
710 raise ValidationError("{0} {1} is not a valid float".format(self.column_name, value))
711
712 def to_python(self, value):
713 return self.validate(value)

Callers 2

to_pythonMethod · 0.95
to_databaseMethod · 0.95

Calls 2

ValidationErrorClass · 0.90
validateMethod · 0.45

Tested by

no test coverage detected