Commits

Mike Bayer  committed 79797e7

- fixed bug where "from" clause gathering from an
over() clause would be an itertools.chain() and
not a list, causing "can only concatenate list"
TypeError when combined with other clauses.

  • Participants
  • Parent commits c01c12a

Comments (0)

Files changed (3)

     will be coerced to integer.  [ticket:2116]
     (also in 0.6.7)
 
+  - fixed bug where "from" clause gathering from an
+    over() clause would be an itertools.chain() and
+    not a list, causing "can only concatenate list"
+    TypeError when combined with other clauses.
+
 - engine
   - The C extension is now enabled by default on CPython
     2.x with a fallback to pure python if it fails to

File lib/sqlalchemy/sql/expression.py

 
     @property
     def _from_objects(self):
-        return itertools.chain(
+        return list(itertools.chain(
             *[c._from_objects for c in 
                 (self.func, self.partition_by, self.order_by) 
             if c is not None]
-        )
+        ))
 
 class _Label(ColumnElement):
     """Represents a column label (AS).

File test/sql/test_compiler.py

             "AS anon_1 FROM mytable"
         )
 
+        # this tests that _from_objects 
+        # concantenates OK
+        self.assert_compile(
+            select([column("x") + over(func.foo())]),
+            "SELECT x + foo() OVER () AS anon_1"
+        )
 
 
     def test_date_between(self):