kaxil commented on code in PR #60651:
URL: https://github.com/apache/airflow/pull/60651#discussion_r2705978279
##########
providers/microsoft/winrm/src/airflow/providers/microsoft/winrm/operators/winrm.py:
##########
@@ -122,3 +180,28 @@ def execute(self, context: Context) -> list | str:
stderr_output = b"".join(stderr_buffer).decode(self.output_encoding)
error_msg = f"Error running cmd: {self.command}, return code:
{return_code}, error: {stderr_output}"
raise AirflowException(error_msg)
+
+ def execute_complete(
+ self,
+ context: Context,
+ event: dict[Any, Any] | None = None,
+ ) -> Any:
+ """
+ Execute callback when WinRMCommandOutputTrigger finishes execution.
+
+ This method gets executed automatically when WinRMCommandOutputTrigger
completes its execution.
+ """
+ if event:
+ status = event.get("status")
+ return_code = event.get("return_code")
+
+ self.log.info("%s completed with %s", self.task_id, status)
+
+ stdout = base64.standard_b64decode(event.get("stdout", b""))
Review Comment:
Some mypy failures
##########
providers/microsoft/winrm/src/airflow/providers/microsoft/winrm/operators/winrm.py:
##########
@@ -122,3 +180,28 @@ def execute(self, context: Context) -> list | str:
stderr_output = b"".join(stderr_buffer).decode(self.output_encoding)
error_msg = f"Error running cmd: {self.command}, return code:
{return_code}, error: {stderr_output}"
raise AirflowException(error_msg)
+
+ def execute_complete(
+ self,
+ context: Context,
+ event: dict[Any, Any] | None = None,
+ ) -> Any:
+ """
+ Execute callback when WinRMCommandOutputTrigger finishes execution.
+
+ This method gets executed automatically when WinRMCommandOutputTrigger
completes its execution.
+ """
+ if event:
+ status = event.get("status")
+ return_code = event.get("return_code")
+
+ self.log.info("%s completed with %s", self.task_id, status)
+
+ stdout = base64.standard_b64decode(event.get("stdout", b""))
Review Comment:
Some mypy failures:
https://github.com/apache/airflow/actions/runs/21149569275/job/60823129312?pr=60651
--
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]