You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ashb (via GitHub)" <gi...@apache.org> on 2025/02/10 10:08:45 UTC

Re: [PR] AIP-72: Improving Operator Links Interface to Prevent User Code Execution in Webserver [airflow]

ashb commented on code in PR #46613:
URL: https://github.com/apache/airflow/pull/46613#discussion_r1948767468


##########
task_sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -717,7 +717,11 @@ def _push_xcom_if_needed(result: Any, ti: RuntimeTaskInstance):
     _xcom_push(ti, "return_value", result, mapped_length=mapped_length)
 
 
-def finalize(log: Logger): ...
+def finalize(ti: RuntimeTaskInstance, log: Logger):
+    for oe in ti.task.operator_extra_link_dict.values():
+        link, xcom_key = oe.get_link(operator=ti.task, ti_key=ti.id), oe.xcom_key  # type: ignore[arg-type]
+        log.debug("Setting xcom for operator extra link", link=link, xcom_key=xcom_key)
+        _xcom_push(ti, key=xcom_key, value=link)

Review Comment:
   Question on previous behaviuor? Where links available for failed tasks? I guess they were (in which case this is the right place to do it.)



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org