I'm attempting to insert a modified document back to Cassandra DB with a new key. I'm having hard time figuring out what is the issue the error message is pointing at. When looking for others that have had similar problems the answers seem to be related to the keys, and in my case the None is just a value of few of the keys. How do I solve this issue?
keys = ','.join(current.keys())
params = [':' + x for x in current.keys()]
values = ','.join(params)
query = "INSERT INTO wiki.pages (%s) Values (%s)" % (keys, values)
query = query.encode('utf-8')
cursor.execute(query, current)
Here's the data for query and current:
INSERT INTO wiki.pages (changed,content,meta,attachment,revision,page,editor)
VALUES (:changed,:content,:meta,:attachment,:revision,:page,:editor)
{
u'changed': '2013-02-15 16:31:49',
u'content': 'Testing',
u'meta': None,
u'attachment': None,
u'revision': 2,
u'page': u'FrontPage',
u'editor': 'Anonymous'
}
This fails with the following error:
cql.apivalues.ProgrammingError:
Bad Request: line 1:123 no viable alternative at input 'None'