seanghaeli commented on code in PR #66608:
URL: https://github.com/apache/airflow/pull/66608#discussion_r3351314450
##########
airflow-core/src/airflow/triggers/callback.py:
##########
@@ -51,14 +98,19 @@ def serialize(self) -> tuple[str, dict[str, Any]]:
async def run(self) -> AsyncIterator[TriggerEvent]:
try:
yield TriggerEvent({PAYLOAD_STATUS_KEY: CallbackState.RUNNING})
+ if self.callback_path.startswith("unusual_prefix_"):
+ await asyncio.to_thread(_ensure_bundle_module_registered,
self.callback_path)
callback = import_string(self.callback_path)
- # TODO: get full context and run template rendering. Right now, a
simple context is included in `callback_kwargs`
- context = self.callback_kwargs.pop("context", None)
+
+ # self.context is set by TriggerRunner from workload.dag_run_data
before run() is called.
+ context = self.context
+
+ kwargs = dict(self.callback_kwargs)
Review Comment:
Added the fallback as bakcwards compat.
--
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]