db assertion failure with item_frequencies (or custom map_reduce function)

15 views
Skip to first unread message

Edwardr

unread,
Feb 8, 2012, 10:58:38 AM2/8/12
to MongoEngine Users
Hi,

Getting a strange error when I try and run item_frequencies on an
optional StringField() within a document that directly inherits from
Document. I know that a large portion of the documents in the
collection do not have the field present.

Firstly, when I execute Collection.item_frquencies('required_field'),
i.e., on a field I know has a value in every document the function
works fine, but when I change the field to an optional field I keep
getting the following error:

Traceback (most recent call last):
File "products.py", line 126, in <module>
res = Product.objects().item_frequencies('part_origin')
File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/
mongoengine-0.5.1-py2.7.egg/mongoengine/queryset.py", line 1521, in
item_frequencies
return self._item_frequencies_map_reduce(field,
normalize=normalize)
File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/
mongoengine-0.5.1-py2.7.egg/mongoengine/queryset.py", line 1551, in
_item_frequencies_map_reduce
for f in values:
File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/
mongoengine-0.5.1-py2.7.egg/mongoengine/queryset.py", line 957, in
map_reduce
results = getattr(self._collection, map_reduce_function)(map_f,
reduce_f, **mr_args)
File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/
pymongo/collection.py", line 1073, in inline_map_reduce
out={"inline": 1}, **kwargs)
File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/
pymongo/database.py", line 340, in command
msg, allowable_errors)
File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/
pymongo/helpers.py", line 125, in _check_command_response
raise OperationFailure(ex_msg, response.get("assertionCode"))
pymongo.errors.OperationFailure: db assertion failure, assertion:
'assertion db/commands/mr.cpp:400'

Any ideas? Thanks!

Wilson Jr

unread,
Feb 8, 2012, 12:10:48 PM2/8/12
to mongoeng...@googlegroups.com
is fixed in mongoengine-dev :-)
Reply all
Reply to author
Forward
0 new messages