This issue is regarding the object mapper of the Datastax Cassandra python driver. When trying to create a Model with a "Set" of UDT as a field, I get the error: TypeError: unhashable type: '[UdtClassName]'
However, I am able to create a Model with a Set of a basic type (e.g. Text) or a Model with a List of UDT.
Note that this is issue seem to exist only with the object mapper since I am able to create sets of UDTs in Cassandra using CQL queries.
Anyone has encountered this problem before? Anyone has an advice?
I am running cassandra python driver 3.2.2, with python 3.4.4
This is possible in Cassandra (and using the core driver directly), but the cqlengine mapper does not support it presently. The reason is a legacy API limitation, where the mapper normalizes to basic python types for sets and maps. The API thus has the same requirement of hashability for set elements and map keys.
We have a ticket open here, but it will need to wait for the next major release since it means a change in API.
You might try working around this by providing a hash on your UDT model class (if it makes sense).