stijndehaes commented on code in PR #27834:
URL: https://github.com/apache/airflow/pull/27834#discussion_r1033304372
##########
airflow/models/dagrun.py:
##########
@@ -780,8 +780,7 @@ def _expand_mapped_task_if_needed(ti: TI) -> Iterable[TI] |
None:
except NotMapped: # Not a mapped task, nothing needed.
return None
if expanded_tis:
- assert expanded_tis[0] is ti
- return expanded_tis[1:]
+ return expanded_tis
Review Comment:
I explicitely return all here
Since there are 2 use cases for the `-1` instance:
- it might be deleted
- it might have a changed index
I now return all so I do not have to care about what happened on line 805.
If there was an expansion, I just add all so they will looped over.
If we only return new ones I would have to detect that on line 805 somehow.
I hope this makes the current way it works more clear.
If you want I could only return new ti objects, but I would need to figure
out a way to see if the ti in the loop has been deleted yes or no
--
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]