From: Mike Bayer Date: Thu, 5 Jul 2007 17:28:31 +0000 (+0000) Subject: - the type of a _BooleanExpression should always be Boolean X-Git-Tag: rel_0_4_6~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a9567aa3a36f2220e9190aec3febbe781cce825;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - the type of a _BooleanExpression should always be Boolean - added a random generative select() to a test (need to add the real tests to either select.py or generative.py) --- diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index cabba25a77..a4808623e0 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -1281,7 +1281,7 @@ class _CompareMixin(object): else: obj = self._check_literal(obj) - return _BinaryExpression(self._compare_self(), obj, operator, type=self._compare_type(obj), negate=negate) + return _BinaryExpression(self._compare_self(), obj, operator, type=sqltypes.Boolean, negate=negate) def _operate(self, operator, obj): if _is_literal(obj): diff --git a/test/orm/query.py b/test/orm/query.py index 76ba9f124a..8b006c922a 100644 --- a/test/orm/query.py +++ b/test/orm/query.py @@ -323,7 +323,7 @@ class InstancesTest(QueryTest): l = q.all() assert l == expected - s = select([users, func.count(addresses.c.id).label('count')], from_obj=[users.outerjoin(addresses)], group_by=[c for c in users.c], order_by=[users.c.id]) + s = select([users, func.count(addresses.c.id).label('count')]).select_from(users.outerjoin(addresses)).group_by(*[c for c in users.c]).order_by(users.c.id) q = sess.query(User) l = q.instances(s.execute(), "count") assert l == expected