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


##########
task-sdk/src/airflow/sdk/bases/operator.py:
##########
@@ -1607,6 +1615,22 @@ 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)

Review Comment:
   Looks like `dry_run` is still used in a handful of tests. It’s also used by 
`TI.dry_run()` (probably should also get rid of that).
   
   Also it’s somehow called in `SFTPToWasbOperator`’s `__init__`! Which means 
we’d break every use of that operator if we remove the function outright. What 
the f.



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