make DCT return typestring with aliases included
PYTHON-579
This commit is contained in:
@@ -988,6 +988,14 @@ class CompositeType(_ParameterizedType):
|
|||||||
class DynamicCompositeType(CompositeType):
|
class DynamicCompositeType(CompositeType):
|
||||||
typename = "org.apache.cassandra.db.marshal.DynamicCompositeType"
|
typename = "org.apache.cassandra.db.marshal.DynamicCompositeType"
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def cass_parameterized_type_with(cls, subtypes, full=False, **kwargs):
|
||||||
|
if not full: # short-circuit for unparsed type
|
||||||
|
return super(DynamicCompositeType, cls).cass_parameterized_type_with(subtypes)
|
||||||
|
# DCT is always formatted "full", and will always have subtypes (otherwise it is normalized to CompositeType by the server)
|
||||||
|
sublist = ', '.join('%s=>%s' % (alias, typ.cass_parameterized_type(full=True)) for alias, typ in zip(cls.fieldnames, subtypes))
|
||||||
|
return '%s(%s)' % (cls.typename, sublist)
|
||||||
|
|
||||||
|
|
||||||
class ColumnToCollectionType(_ParameterizedType):
|
class ColumnToCollectionType(_ParameterizedType):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user