[Sqlalchemy-tickets] [sqlalchemy] #2117: boolean literals accepted for BooleanClause in 0.6, not in
Brought to you by:
zzzeek
From: sqlalchemy <mi...@zz...> - 2011-03-31 15:53:54
|
#2117: boolean literals accepted for BooleanClause in 0.6, not in 0.7 --------------------+------------------------------------------------------- Reporter: guest | Owner: zzzeek Type: defect | Status: new Priority: medium | Milestone: Component: sql | Severity: no triage selected yet Keywords: | Status_field: awaiting triage --------------------+------------------------------------------------------- This code works on 0.6: {{{ from sqlalchemy import * t = Table('t', MetaData(), Column('id', Integer, primary_key=True)) and_(t.c.id == 3, False) }}} (although it compiles with a non-standard capitalized {{{False}}} in SQL) It fails on 0.7 (current tip of default branch) with: {{{ Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/gthb/extsvn/sqlalchemy/lib/sqlalchemy/sql/expression.py", line 409, in and_ return BooleanClauseList(operator=operators.and_, *clauses) File "/Users/gthb/extsvn/sqlalchemy/lib/sqlalchemy/sql/expression.py", line 2919, in __init__ super(BooleanClauseList, self).__init__(*clauses, **kwargs) File "/Users/gthb/extsvn/sqlalchemy/lib/sqlalchemy/sql/expression.py", line 2848, in __init__ for clause in clauses if clause is not None] File "/Users/gthb/extsvn/sqlalchemy/lib/sqlalchemy/sql/expression.py", line 1189, in _literal_as_text "SQL expression object or string expected." sqlalchemy.exc.ArgumentError: SQL expression object or string expected. }}} Replacing {{{False}}} with {{{'false'}}} works (and it works in {{{rel_0_6}}} as well). If it's an intentional change, it is not documented in [wiki:07Migration]. -- Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2117> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |