#1865 Fix our chunked_iterator so it requeries each chunk rather than trying to modify the existing query

v1.0.0
closed
sf-1 (616)
General
nobody
2015-08-20
2011-04-01
No
Traceback (most recent call last):
  File "/var/local/env-allura/bin/paster", line 8, in <module>
    load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')()
  File "/var/local/env-allura/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 84, in run
    invoke(command, command_name, options, args[1:])
  File "/var/local/env-allura/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 123, in invoke 
    exit_code = runner.run(args)
  File "/var/local/env-allura/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 218, in run
    result = self.command()
  File "/var/local/allura/Allura/allura/command/show_models.py", line 51, in command
    for projects in utils.chunked_iterator(q_project):
  File "/var/local/allura/Allura/allura/lib/utils.py", line 96, in chunked_iterator
    .skip(pagesize*page)
  File "/var/local/env-allura/lib/python2.6/site-packages/Ming-0.2.1dev_20110324-py2.6.egg/ming/orm/ormsession.py", line 235, in skip
    self.ming_cursor.skip(skip))
  File "/var/local/env-allura/lib/python2.6/site-packages/Ming-0.2.1dev_20110324-py2.6.egg/ming/base.py", line 400, in skip
    self.cursor = self.cursor.skip(skip)
  File "/var/local/env-allura/lib/python2.6/site-packages/pymongo-1.9-py2.6-linux-x86_64.egg/pymongo/cursor.py", line 264, in skip  
    self.__check_okay_to_chain()
  File "/var/local/env-allura/lib/python2.6/site-packages/pymongo-1.9-py2.6-linux-x86_64.egg/pymongo/cursor.py", line 205, in __check_okay_to_chain
    raise InvalidOperation("cannot set options after executing query")
pymongo.errors.InvalidOperation: cannot set options after executing query

Discussion

  • Rick Copeland - 2011-04-01
    • status: in-progress --> code-review
    • assigned_to: Rick Copéland --> John Hoffmann
     
  • Rick Copeland - 2011-04-01

    To QA: mainly just code review, a test has been added as well

     
  • John Hoffman - 2011-04-01
    • assigned_to: John Hoffmann --> Jenny Steele
     
  • John Hoffman - 2011-04-01

    Jenny can you merge this when you merge 1771 into dev?

     
  • Jenny Steele - 2011-04-01
    • status: code-review --> closed
     

Log in to post a comment.