]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Deprecate negative slice indexes
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 22 Sep 2020 14:26:35 +0000 (10:26 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 22 Sep 2020 18:26:18 +0000 (14:26 -0400)
commit96888aee7611c15532af2ae47e567f68c28b2474
tree88fa6819b09463a2b3b652c48ea9c3e370ba9443
parente973fd5d5712b7212624b329015633fecfd1a25c
Deprecate negative slice indexes

The "slice index" feature used by :class:`_orm.Query` as well as by the
dynamic relationship loader will no longer accept negative indexes in
SQLAlchemy 2.0.  These operations do not work efficiently and load the
entire collection in, which is both surprising and undesirable.   These
will warn in 1.4 unless the :paramref:`_orm.Session.future` flag is set in
which case they will raise IndexError.

Fixes: #5606
Change-Id: I5f5dcf984a8f41ab3d0e233ef7553e77fd99a771
doc/build/changelog/unreleased_14/5606.rst [new file with mode: 0644]
lib/sqlalchemy/orm/dynamic.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/util.py
test/orm/test_deprecations.py
test/orm/test_dynamic.py
test/orm/test_generative.py
test/orm/test_query.py