uranusjr opened a new pull request, #75751: URL: https://github.com/apache/airflow/pull/75751
A mapped task's template context is built before unmapping, so its inlets and outlets only came from partial(). Anything the operator's `__init__` added was missing from `context["inlets"]`, `["outlets"]`, `["inlet_events"]`, and `["asset_state_store"]`. For example, a mapped sensor that adds its asset in `__init__` gets a KeyError from `context["inlet_events"][asset]` (#70225). `context_update_for_unmapped` now refreshes these entries from the unmapped task. It rebuilds the accessors only when the inlets or outlets have changed. Mapped tasks now behave like non-mapped ones, which changes two things: * `context["inlets"]` and `["outlets"]` are now the task's own lists, so appending to `context["outlets"]` in `execute()` takes effect. * If `__init__` adds a second asset, calling `context["asset_state_store"].get(...)` without a subscript raises ValueError. -- 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]
