From cb19f227f31701322f398b5bdd77427dfc81da0d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 2 Feb 2013 16:17:58 -0500 Subject: The :meth:`.ColumnOperators.in_` operator will now coerce values of ``None`` to :func:`.null`. [ticket:2496] --- lib/sqlalchemy/sql/expression.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/sqlalchemy/sql/expression.py') diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index de728f77b..90837f4ab 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -2084,6 +2084,8 @@ class _DefaultColumnComparator(operators.ColumnOperators): raise exc.InvalidRequestError('in() function accept' 's either a list of non-selectable values, ' 'or a selectable: %r' % o) + elif o is None: + o = null() else: o = expr._bind_param(op, o) args.append(o) -- cgit v1.2.1