pycassa/pycassa — Issue #117: TypeError: A str or unicode value was expected, but UUID was received instead
Author: stodge
Created: 2012-01-25 16:22:34+00:00
State: open

I'm following this tutorial:

http://pycassa.github.com/pycassa/assorted/column_family_map.html

My code:

```
class License(object):
key = LexicalUUIDType()
name = UTF8Type()
description = UTF8Type()
created = DateType()

l = License()
l.key = uuid.uuid1()
l.name = "Test License"
l.description = "Test license description."
l.created = datetime.datetime.utcnow()
LICENSE.insert(l)
```

I get an error:

```
Traceback (most recent call last):
File "./gen.py", line 48, in
LICENSE.insert(l)
File "/usr/lib/python2.7/site-packages/pycassa-1.4.0-py2.7.egg/pycassa/columnfamilymap.py", line 239, in insert
write_consistency_level=write_consistency_level)
File "/usr/lib/python2.7/site-packages/pycassa-1.4.0-py2.7.egg/pycassa/columnfamily.py", line 847, in insert
packed_key = self._pack_key(key)
File "/usr/lib/python2.7/site-packages/pycassa-1.4.0-py2.7.egg/pycassa/columnfamily.py", line 450, in _pack_key
return self._key_packer(key)
File "/usr/lib/python2.7/site-packages/pycassa-1.4.0-py2.7.egg/pycassa/marshal.py", line 224, in pack_bytes
% (v.__class__.__name__, str(v)))
TypeError: A str or unicode value was expected, but UUID was received instead (d341d895-3fef-4fd1-a5e0-ab7d20716edc)
```
Maybe Picassa uses the LexicalUUIDType type, but the underlying thrift generated code doesn't?

Thanks