]> 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:27 +0000 (20:26 -0400)
commit97d2a2091ed4caee1e19168d0db39e4d94a6d12f
tree2540d73d73d5638562bdbd1d4c79bf23c60c6779
parentf5e57f7c311288d892894edcc44d901b5bfbb3d1
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
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