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


##########
airflow/providers/amazon/aws/triggers/emr.py:
##########
@@ -102,274 +102,184 @@ async def run(self):
             yield TriggerEvent({"status": "success", "message": "Steps 
completed", "step_ids": self.step_ids})
 
 
-class EmrCreateJobFlowTrigger(BaseTrigger):
+class EmrCreateJobFlowTrigger(AwsBaseWaiterTrigger):
     """
     Asynchronously poll the boto3 API and wait for the JobFlow to finish 
executing.
 
     :param job_flow_id: The id of the job flow to wait for.
-    :param poll_interval: The amount of time in seconds to wait between 
attempts.
-    :param max_attempts: The maximum number of attempts to be made.
+    :param waiter_delay: The amount of time in seconds to wait between 
attempts.
+    :param waiter_max_attempts: The maximum number of attempts to be made.
     :param aws_conn_id: The Airflow connection used for AWS credentials.
     """
 
     def __init__(
         self,
         job_flow_id: str,
-        poll_interval: int,
-        max_attempts: int,
-        aws_conn_id: str,
+        poll_interval: int | None = None,  # deprecated
+        max_attempts: int | None = None,  # deprecated
+        aws_conn_id: str | None = None,
+        waiter_delay: int = 30,
+        waiter_max_attempts: int = 60,
     ):
-        self.job_flow_id = job_flow_id
-        self.poll_interval = poll_interval
-        self.max_attempts = max_attempts
-        self.aws_conn_id = aws_conn_id
-
-    def serialize(self) -> tuple[str, dict[str, Any]]:
-        return (
-            self.__class__.__module__ + "." + self.__class__.__qualname__,
-            {
-                "job_flow_id": self.job_flow_id,
-                "poll_interval": str(self.poll_interval),
-                "max_attempts": str(self.max_attempts),
-                "aws_conn_id": self.aws_conn_id,
-            },
+        if poll_interval is not None or max_attempts is not None:

Review Comment:
   Here and elsewhere:
   
   ```suggestion
           if poll_interval or max_attempts:
   ```



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