ashb commented on code in PR #69565:
URL: https://github.com/apache/airflow/pull/69565#discussion_r3540105258
##########
airflow-core/src/airflow/models/dagrun.py:
##########
@@ -2048,16 +2047,17 @@ def _revise_map_indexes_if_mapped(
)
session.flush()
+ new_tis: list[TI] = []
for index in range(total_length):
if index in existing_indexes:
continue
ti = TI(task, run_id=self.run_id, map_index=index, state=None,
dag_version_id=dag_version_id)
self.log.debug("Expanding TIs upserted %s", ti)
- task_instance_mutation_hook(ti, dag_run=self)
- ti = session.merge(ti)
- ti.refresh_from_task(task, dag_run=self)
+ _add_and_prime_mapped_ti(ti, task, self, session=session)
+ new_tis.append(ti)
Review Comment:
Okay, that part makes sense, but I'm not sure I would keep the fn as
`Iterator[TI]` -- it feels like we are only technically returning an iterator,
but with none of the benefit of it? I think I'd change the fn to `Iterable[TI]`
(though seeing what knock on impact that might have might change my stance on
it)
--
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]