ferruzzi commented on code in PR #32274:
URL: https://github.com/apache/airflow/pull/32274#discussion_r1253575212


##########
airflow/providers/amazon/aws/operators/ecs.py:
##########
@@ -139,13 +143,12 @@ def execute(self, context: Context):
             self.log.info("Cluster %r in state: %r.", self.cluster_name, 
cluster_state)
         elif self.deferrable:
             self.defer(
-                trigger=ClusterWaiterTrigger(
-                    waiter_name="cluster_active",
+                trigger=ClusterActiveTrigger(
                     cluster_arn=cluster_details["clusterArn"],

Review Comment:
   I'll make the same suggestion I made in Syed's PR... feel free to ignore it, 
but I see a lot of repetition in the calls to the Triggers and the Waiters.  It 
may be convenient to fold the waiter parameters into a new self.waiter_config 
dict in the Operator's init and just unpack it in the Trigger and Waiter calls, 
something like:
   
   ```
   self.waiter_config = {
       cluster_arn=cluster_details["clusterArn"],
       waiter_delay=self.waiter_delay,
       waiter_max_attempts=self.waiter_max_attempts,
       aws_conn_id=self.aws_conn_id,
       region=self.region,
   }
   ```
   
   then all of the waiters and triggers can reuse that cleanly like:
   
   ```trigger=ClusterActiveTrigger(**self.waiter_config)```



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