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


##########
airflow/providers/amazon/aws/operators/base_aws.py:
##########
@@ -0,0 +1,150 @@
+# 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
+
+import warnings
+from functools import cached_property
+from typing import Any, Generic, Sequence, TypeVar
+
+from typing_extensions import final
+
+from airflow.exceptions import AirflowException, 
AirflowProviderDeprecationWarning
+from airflow.models import BaseOperator
+from airflow.providers.amazon.aws.hooks.base_aws import AwsGenericHook
+
+_AwsHook = TypeVar("_AwsHook", bound=AwsGenericHook)
+_REGION_MSG = "`region` is deprecated and will be removed in the future. 
Please use `region_name` instead."
+
+
+class AwsBaseOperator(BaseOperator, Generic[_AwsHook]):
+    """Base AWS (Amazon) Operator Class for build operators in top of AWS 
Hooks.
+
+    Examples:
+     .. code-block:: python
+
+        from airflow.providers.amazon.aws.hooks.foo_bar import FooBarThinHook, 
FooBarThickHook
+
+
+        class AwsFooBarOperator(AwsBaseOperator[FooBarThinHook]):
+            aws_hook_class = FooBarThinHook
+
+            def execute(self, context):
+                pass
+
+
+        class AwsFooBarOperator2(AwsBaseOperator[FooBarThickHook]):
+            aws_hook_class = FooBarThickHook
+
+            def __init__(self, *, spam: str, **kwargs):
+                super().__init__(**kwargs)
+                self.spam = spam
+
+            @property
+            def _hook_parameters(self):
+                return {**super()._hook_parameters, "spam": self.spam}
+
+            def execute(self, context):
+                pass
+
+    :param aws_conn_id: The Airflow connection used for AWS credentials.
+        If this is None or empty then the default boto3 behaviour is used. If
+        running Airflow in a distributed manner and aws_conn_id is None or
+        empty, then default boto3 configuration would be used (and must be
+        maintained on each worker node).

Review Comment:
   I think this is repeating itself, but maybe I'm missing something.



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