vandonr-amz commented on code in PR #32274:
URL: https://github.com/apache/airflow/pull/32274#discussion_r1253484051


##########
airflow/providers/amazon/aws/triggers/base_trigger.py:
##########
@@ -0,0 +1,127 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from __future__ import annotations
+
+from abc import abstractmethod
+from typing import Any, AsyncIterator
+
+from airflow.providers.amazon.aws.hooks.base_aws import AwsGenericHook
+from airflow.providers.amazon.aws.utils.waiter_with_logging import async_wait
+from airflow.triggers.base import BaseTrigger, TriggerEvent
+
+
+class AwsBaseWaiterTrigger(BaseTrigger):
+    """
+    Base class for all AWS Triggers that follow the "standard" model of just 
waiting on a waiter.
+
+    Subclasses need to implement the hook() method.
+
+    :param serialized_fields: Fields that are specific to the subclass trigger 
and need to be serialized
+        to be passed to the __init__ method on deserialization.
+        format: {<parameter_name>: <parameter_value>}
+
+    :param waiter_name: The name of the (possibly custom) boto waiter to use.
+
+    :param waiter_args: The arguments to pass to the waiter.
+    :param failure_message: The message to log if a failure state is reached.
+    :param status_message: The message logged when printing the status of the 
service.
+    :param status_queries: A list containing the JMESPath queries to retrieve 
status information from
+        the waiter response. See https://jmespath.org/tutorial.html
+
+    :param return_key: The key to use for the return_value in the TriggerEvent 
this emits on success.
+    :param return_value: A value that'll be returned in the return_key field 
of the TriggerEvent.
+
+    :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.
+    :param region_name: The AWS region where the resources to watch are.
+    """
+
+    def __init__(
+        self,
+        *,
+        serialized_fields: dict[str, Any],
+        waiter_name: str,
+        waiter_args: dict[str, Any],
+        failure_message: str,
+        status_message: str,
+        status_queries: list[str],
+        return_key: str = "value",
+        return_value: Any | None,

Review Comment:
   hmm yeah probably. I'll remove it from here and add it to the doc so that 
it's more obvious that it's an accepted value.



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