uranusjr commented on code in PR #23667:
URL: https://github.com/apache/airflow/pull/23667#discussion_r885293374
##########
airflow/models/dagrun.py:
##########
@@ -928,11 +932,26 @@ def expand_mapped_literals(task: "Operator") ->
Tuple["Operator", Sequence[int]]
)
if not count:
return (task, (-1,))
+ if sequence:
+ return (task, sequence)
return (task, range(count))
tasks_and_map_idxs = map(expand_mapped_literals, filter(task_filter,
dag.task_dict.values()))
tasks = itertools.chain.from_iterable(itertools.starmap(creator,
tasks_and_map_idxs))
+ # Check if we have some missing indexes to create ti for
+ missing_indexes: Dict["MappedOperator", list] = defaultdict(list)
+ [
+ missing_indexes.update({k: list(set(expected_indexes[k]) -
set(v))})
+ for k, v in existing_indexes.items()
+ ]
Review Comment:
```suggestion
for k, v in existing_indexes.items():
missing_indexes.update({k:
list(set(expected_indexes[k]).difference(v))})
```
More Pythonic IMO.
--
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]