]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
repair any_() / all_() "implicit flip" behavior for None
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 4 Oct 2021 15:21:35 +0000 (11:21 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 4 Oct 2021 16:04:11 +0000 (12:04 -0400)
commit81f99c1b143d33e275afef7472750b5174294e80
treee0fd0e97a62a8632f80adfca8989d1052fc06b09
parent71e463506217e3acc379a3f459e68a81792a0aac
repair any_() / all_() "implicit flip" behavior for None

Fixed an inconsistency in the any_() / all_() functions / methods where the
special behavior these functions have of "flipping" the expression such
that the "ANY" / "ALL" expression is always on the right side would not
function if the comparison were against the None value, that is,
"column.any_() == None" should produce the same SQL expression as "null()
== column.any_()". Added more docs to clarify this as well, plus mentions
that any_() / all_() generally supersede the ARRAY version "any()" /
"all()".

Fixes: #7140
Change-Id: Ia5d55414ba40eb3fbda3598931fdd24c9b4a4411
doc/build/changelog/unreleased_14/7140.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/array.py
lib/sqlalchemy/sql/default_comparator.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/operators.py
lib/sqlalchemy/sql/sqltypes.py
test/sql/test_operators.py