amoghrajesh commented on code in PR #66160:
URL: https://github.com/apache/airflow/pull/66160#discussion_r3200218573
##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -249,7 +251,14 @@ def get_template_context(self) -> Context:
"value": VariableAccessor(deserialize_json=False),
},
"conn": ConnectionAccessor(),
+ "task_state": TaskStateAccessor(ti_id=self.id),
}
+ if any(isinstance(i, (Asset, AssetNameRef, AssetUriRef)) for i in
self.task.inlets):
+ self._cached_template_context["asset_state"] =
AssetStateAccessors(self.task.inlets)
+ # AssetAlias inlets are intentionally excluded from
AssetStateAccessors.
+ # An alias resolves to multiple concrete assets at runtime, so
there is no
+ # single asset to bind state to. Tasks with only AssetAlias
inlets will not
+ # have `asset_state` in their context.
Review Comment:
This has now been implemented
--
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]