kaxil commented on code in PR #52234:
URL: https://github.com/apache/airflow/pull/52234#discussion_r2185918340


##########
task-sdk/src/airflow/sdk/bases/operator.py:
##########
@@ -1607,6 +1615,216 @@ def resume_execution(self, next_method: str, 
next_kwargs: dict[str, Any] | None,
         execute_callable = getattr(self, next_method)
         return execute_callable(context, **next_kwargs)
 
+    def dry_run(self) -> None:
+        """Perform dry run for the operator - just render template fields."""
+        self.log.info("Dry run")
+        for f in self.template_fields:
+            try:
+                content = getattr(self, f)
+            except AttributeError:
+                raise AttributeError(
+                    f"{f!r} is configured as a template field "
+                    f"but {self.task_type} does not have this attribute."
+                )
+
+            if content and isinstance(content, str):
+                self.log.info("Rendering template for %s", f)
+                self.log.info(content)
+
+    # TODO (GH-52141): Either port this, or somehow fix the tests to remove 
this from the sdk.
+    @staticmethod
+    def xcom_push(
+        context: Any,
+        key: str,
+        value: Any,
+    ) -> None:
+        """
+        Make an XCom available for tasks to pull.
+
+        :param context: Execution Context Dictionary
+        :param key: A key for the XCom
+        :param value: A value for the XCom. The value is pickled and stored
+            in the database.
+        """
+        context["ti"].xcom_push(key=key, value=value)
+
+    # TODO (GH-52141): Either port this, or somehow fix the tests to remove 
this from the sdk.
+    @staticmethod
+    def xcom_pull(
+        context: Any,
+        task_ids: str | list[str] | None = None,
+        dag_id: str | None = None,
+        key: str = "return_value",
+        include_prior_dates: bool | None = None,
+        session=None,
+    ) -> Any:

Review Comment:
   This shouldn't be needed anymore after 
https://github.com/apache/airflow/issues/52378
   
   Atleast not in Providers -- Need to check if `airflow-core/tests` use it -- 
but should be easy.



-- 
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]

Reply via email to