jroachgolf84 commented on code in PR #73135:
URL: https://github.com/apache/airflow/pull/73135#discussion_r4058579147
##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -1410,6 +1436,17 @@ async def create_triggers(self):
trigger_instance.triggerer_job_id = self.job_id
trigger_instance.timeout_after = workload.timeout_after
+ if (ti := workload.ti) is not None:
+ trigger_instance.task_state_store = TaskStateStoreAccessor(
+ ti_id=ti.id,
+ scope=TaskScope(
+ dag_id=ti.dag_id,
+ run_id=ti.run_id,
+ task_id=ti.task_id,
+ map_index=ti.map_index,
Review Comment:
I didn't implement exactly like you mentioned because `TaskInstanceDTO`
defines `map_index` it as a non-optional `int`. Since that DTO is built through
`model_validate`, Pydantic rejects a `None` before it can reach `TaskScope`
I added `test_task_instance_dto_rejects_a_null_map_index`, so if the field
type is ever changed to `int | None` the test fails and flags that the
Triggerer now needs the Worker's fallback.
--
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]