diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2022-01-06 19:15:06 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2022-01-06 19:15:06 +0000 |
commit | dd5f9c2039731adb6c019c4cc3a39694f9b236ad (patch) | |
tree | ce80dd61476c0c09f792f5690c7c7434b7876cc7 /lib/sqlalchemy/orm/util.py | |
parent | f3c93170dcbe705da25bc18bad2b29620d82a490 (diff) | |
parent | 01c50c64e302c193733cef7fb146fbab8eaa44bd (diff) | |
download | sqlalchemy-dd5f9c2039731adb6c019c4cc3a39694f9b236ad.tar.gz |
Merge "Remove all remaining removed_in_20 warnings slated for removal" into main
Diffstat (limited to 'lib/sqlalchemy/orm/util.py')
-rw-r--r-- | lib/sqlalchemy/orm/util.py | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py index 262898127..1c831d48e 100644 --- a/lib/sqlalchemy/orm/util.py +++ b/lib/sqlalchemy/orm/util.py @@ -2046,25 +2046,17 @@ def randomize_unitofwork(): ) = session.set = mapper.set = dependency.set = RandomSet -def _getitem(iterable_query, item, allow_negative): +def _getitem(iterable_query, item): """calculate __getitem__ in terms of an iterable query object that also has a slice() method. """ def _no_negative_indexes(): - if not allow_negative: - raise IndexError( - "negative indexes are not accepted by SQL " - "index / slice operators" - ) - else: - util.warn_deprecated_20( - "Support for negative indexes for SQL index / slice operators " - "will be " - "removed in 2.0; these operators fetch the complete result " - "and do not work efficiently." - ) + raise IndexError( + "negative indexes are not accepted by SQL " + "index / slice operators" + ) if isinstance(item, slice): start, stop, step = util.decode_slice(item) |