]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Use ternary when running conditional with Query._offset
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 11 Aug 2019 14:54:49 +0000 (10:54 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 12 Aug 2019 00:26:49 +0000 (20:26 -0400)
commitc37c31a90fad5b6da5b73882afddb0e5d292d2f8
treee4c7223757e1adb5df55ef04b80968a47f20a178
parentd890ce67d877fa2b6a20bbda084eb6c21d166ae7
Use ternary when running conditional with Query._offset

Fixed bug where using :meth:`.Query.first` or a slice expression in
conjunction with a query that has an expression based "offset" applied
would raise TypeError, due to an "or" conditional against "offset" that did
not expect it to be a SQL expression as opposed to an integer or None.

Fixes: #4803
Change-Id: I56b97a5d23cb45427a27a90ab557fa1ac5c6739e
(cherry picked from commit 97d2a2091ed4caee1e19168d0db39e4d94a6d12f)
doc/build/changelog/unreleased_13/4803.rst [new file with mode: 0644]
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/testing/requirements.py
test/orm/test_query.py
test/requirements.py