uranusjr commented on code in PR #57862:
URL: https://github.com/apache/airflow/pull/57862#discussion_r2497075031
##########
airflow-core/src/airflow/models/taskmap.py:
##########
@@ -229,7 +230,8 @@ def expand_mapped_task(
TaskInstance.run_id == run_id,
)
)
- indexes_to_map = range(current_max_mapping + 1, total_length)
+ start_index = (current_max_mapping or -1) + 1
Review Comment:
This would cause current_max_mapping=0 to be coerced to -1. The check should
be something like
```python
if current_max_mapping is None:
index_to_map = range(total_length)
else:
index_to_map = range(current_max_mapping + 1, total_length)
```
instead.
Or we can use try-catch with `scalars(...).one()` instead.
--
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]