uranusjr commented on code in PR #75751:
URL: https://github.com/apache/airflow/pull/75751#discussion_r4704395136
##########
task-sdk/src/airflow/sdk/execution_time/context.py:
##########
@@ -1707,15 +1774,27 @@ def context_update_for_unmapped(context: Context, task:
BaseOperator) -> None:
contains information about the mapped task. We need to do some in-place
updates to ensure the template context reflects the unmapped task instead.
+ This includes the asset accessors, since the operator's ``__init__`` (which
+ only runs on unmapping) may add inlets and outlets. Creating them makes no
+ supervisor calls; they are built later.
+
:meta private:
"""
from airflow.sdk.definitions.param import process_params
- context["task"] = context["ti"].task = task
+ context["task"] = (ti := context["ti"]).task = task
context["params"] = process_params(
context["dag"], task, context["dag_run"].conf, suppress_exception=False
)
+ context["inlets"] = task.inlets
+ context["outlets"] = task.outlets
+ context["inlet_events"] = InletEventsAccessors(task.inlets)
+ if (asset_state_store := create_asset_state_store(ti)) is None:
+ context.pop("asset_state_store", None)
Review Comment:
Test added
--
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]