Skip to content

Commit

Permalink
Removed keeptemp from map_reduce as 0.5 requires pymongo 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
rozza committed Aug 17, 2011
1 parent 97ac7e5 commit 11621c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mongoengine/queryset.py
Expand Up @@ -872,7 +872,7 @@ def __len__(self):
return self.count()

def map_reduce(self, map_f, reduce_f, output, finalize_f=None, limit=None,
scope=None, keep_temp=False):
scope=None):
"""Perform a map/reduce query using the current query spec
and ordering. While ``map_reduce`` respects ``QuerySet`` chaining,
it must be the last call made, as it does not return a maleable
Expand Down Expand Up @@ -920,7 +920,7 @@ def map_reduce(self, map_f, reduce_f, output, finalize_f=None, limit=None,
reduce_f_code = self._sub_js_fields(reduce_f)
reduce_f = pymongo.code.Code(reduce_f_code, reduce_f_scope)

mr_args = {'query': self._query, 'keeptemp': keep_temp}
mr_args = {'query': self._query}

if finalize_f:
finalize_f_scope = {}
Expand All @@ -937,7 +937,7 @@ def map_reduce(self, map_f, reduce_f, output, finalize_f=None, limit=None,
if limit:
mr_args['limit'] = limit

if output == 'inline' or (not keep_temp and not self._ordering):
if output == 'inline' and not self._ordering:
map_reduce_function = 'inline_map_reduce'
else:
map_reduce_function = 'map_reduce'
Expand Down Expand Up @@ -1514,7 +1514,7 @@ def _item_frequencies_map_reduce(self, field, normalize=False):
return total;
}
"""
values = self.map_reduce(map_func, reduce_func, 'inline', keep_temp=False)
values = self.map_reduce(map_func, reduce_func, 'inline')
frequencies = {}
for f in values:
key = f.key
Expand Down

0 comments on commit 11621c6

Please sign in to comment.