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

Method validate

cassandra/cqlengine/columns.py:402–419  ·  view source on GitHub ↗

Only allow ASCII and None values. Check against US-ASCII, a.k.a. 7-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the Unicode character set. Source: https://github.com/apache/cassandra/blob /3dcbe90e02440e6ee534f643c7603d50ca08482b/src/java/org/apache

(self, value)

Source from the content-addressed store, hash-verified

400 db_type = 'ascii'
401
402 def validate(self, value):
403 """ Only allow ASCII and None values.
404
405 Check against US-ASCII, a.k.a. 7-bit ASCII, a.k.a. ISO646-US, a.k.a.
406 the Basic Latin block of the Unicode character set.
407
408 Source: https://github.com/apache/cassandra/blob
409 /3dcbe90e02440e6ee534f643c7603d50ca08482b/src/java/org/apache/cassandra
410 /serializers/AsciiSerializer.java#L29
411 """
412 value = super(Ascii, self).validate(value)
413 if value:
414 charset = value if isinstance(
415 value, (bytearray, )) else map(ord, value)
416 if not set(range(128)).issuperset(charset):
417 raise ValidationError(
418 '{!r} is not an ASCII string.'.format(value))
419 return value
420
421
422class Integer(Column):

Callers

nothing calls this directly

Calls 4

ValidationErrorClass · 0.90
setFunction · 0.85
validateMethod · 0.45
issupersetMethod · 0.45

Tested by

no test coverage detected