Merge pull request #747 from datastax/python-742

PYTHON-742: Ensure UDT are validated
This commit is contained in:
Jim Witschey 2017-05-08 13:53:21 -07:00 committed by GitHub
commit 91e389f2c6

View File

@ -973,6 +973,13 @@ class UserDefinedType(Column):
field_names=[c.db_field_name for c in self.user_type._fields.values()], field_names=[c.db_field_name for c in self.user_type._fields.values()],
field_types=[c.cql_type for c in self.user_type._fields.values()]) field_types=[c.cql_type for c in self.user_type._fields.values()])
def validate(self, value):
val = super(UserDefinedType, self).validate(value)
if val is None:
return
val.validate()
return val
def resolve_udts(col_def, out_list): def resolve_udts(col_def, out_list):
for col in col_def.sub_types: for col in col_def.sub_types: