Skip to content

Commit

Permalink
Also optimize range where step is -1
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Nov 18, 2022
1 parent 1bd31cc commit 13c590e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion airflow/models/xcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def get_many(
elif dag_ids is not None:
query = query.filter(cls.dag_id == dag_ids)

if isinstance(map_indexes, range) and map_indexes.step == 1:
if isinstance(map_indexes, range) and abs(map_indexes.step) == 1:
query = query.filter(cls.map_index >= map_indexes.start, cls.map_index < map_indexes.stop)
elif is_container(map_indexes):
query = query.filter(cls.map_index.in_(map_indexes))
Expand Down

0 comments on commit 13c590e

Please sign in to comment.