Query._statement boolean value is not defined

Issue #2199 resolved
Former user created an issue

In Query._no_statement_condition, self._statement is being checked for its boolean value without using "is not None". When self._statement is a ClauseElement, this breaks with a TypeError.

http://www.sqlalchemy.org/trac/browser/lib/sqlalchemy/orm/query.py?rev=7641%3A6723b52c44bc

To reproduce: 1. Create a Query and a Select object 2. query_obj.from_statement(select_obj).offset(123) 3. Raises TypeError in _no_statement_condition

This bug has been observed in 0.6.7, 0.6.8 and seems to be present in the default branch as well.

Comments (2)

  1. Log in to comment