Taragolis commented on code in PR #34890:
URL: https://github.com/apache/airflow/pull/34890#discussion_r1358018273


##########
airflow/providers/amazon/aws/operators/lambda_function.py:
##########
@@ -62,13 +61,15 @@ class LambdaCreateFunctionOperator(BaseOperator):
     :param aws_conn_id: The AWS connection ID to use
     """
 
+    aws_hook_class = LambdaHook
     template_fields: Sequence[str] = (
         "function_name",
         "runtime",
         "role",
         "handler",
         "code",
         "config",
+        *AwsBaseOperator.template_fields,

Review Comment:
   I just thought about another option, create helper function for apply 
default parameters
   
   ```python
   from airflow.compat.functools import cache
   
   @cache
   def aws_template_fields(*templated_fields: str) -> tuple[str]:
       return tuple(sorted(list({"aws_conn_id", "region_name", "verify"} | 
set(templated_fields))))
   
   
   class SomeOperator:
       template_fields: Sequence[str] = aws_template_fields(
           "function_name",
           "runtime",
           "role",
           "handler",
           "code",
           "config",
      )
   ```
   
   WDYT?



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