Lee-W commented on code in PR #36550:
URL: https://github.com/apache/airflow/pull/36550#discussion_r1443600973


##########
airflow/providers/amazon/aws/sensors/redshift_cluster.py:
##########
@@ -66,6 +72,38 @@ def poke(self, context: Context):
         )
         return current_status == self.target_status
 
+    def execute(self, context: Context) -> None:
+        if not self.deferrable:
+            super().execute(context=context)
+        elif not self.poke(context):
+            self.defer(
+                timeout=timedelta(seconds=self.timeout),
+                trigger=RedshiftClusterSensorTrigger(
+                    aws_conn_id=self.aws_conn_id,
+                    cluster_identifier=self.cluster_identifier,
+                    target_status=self.target_status,
+                    poke_interval=self.poke_interval,
+                ),
+                method_name="execute_complete",
+            )
+
+    def execute_complete(self, context: Context, event: dict[str, Any] | None 
= None) -> None:
+        if event is None:
+            err_msg = "Trigger error: event is None"
+            self.log.info(err_msg)

Review Comment:
   Sounds good! Just changed it to error



-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to