uranusjr commented on code in PR #27827:
URL: https://github.com/apache/airflow/pull/27827#discussion_r1029993902
##########
airflow/models/xcom.py:
##########
@@ -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 abs(map_indexes.step) == 1:
+ if isinstance(map_indexes, range) and map_indexes.step == 1:
query = query.filter(cls.map_index >= map_indexes.start,
cls.map_index < map_indexes.stop)
Review Comment:
The previous logic was wrong; this optimisation only holds when `step=1`. We
could make `step=-1` work (by flipping `start` and `end` conditionally but I
decided it’s not worth it since that case is not used anywhere.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]