amoghrajesh commented on code in PR #39300:
URL: https://github.com/apache/airflow/pull/39300#discussion_r1582533396


##########
airflow/providers/amazon/aws/hooks/lambda_function.py:
##########
@@ -106,6 +106,9 @@ def create_lambda(
         image_config: Any | None = None,
         code_signing_config_arn: str | None = None,
         architectures: list[str] | None = None,
+        ephemeral_storage: Any | None = None,

Review Comment:
   Can this be Any? Or should we have a proper type and define a default as 
well?



##########
tests/providers/amazon/aws/operators/test_lambda_function.py:
##########
@@ -125,6 +125,38 @@ def test_create_lambda_deferrable(self, _):
         with pytest.raises(TaskDeferred):
             operator.execute(None)
 
+    @mock.patch.object(LambdaHook, "create_lambda")
+    @mock.patch.object(LambdaHook, "conn")
+    @pytest.mark.parametrize(
+        "config",
+        [
+            pytest.param({"architectures": ["arm64"],
+                          "logging_config": {
+                              "LogFormat": "Text",
+                              "LogGroup": "/custom/log-group/"
+                          }
+                          }, id="with-config-argument"),
+        ],
+    )
+    def test_create_lambda_using_config_argument(self,
+                                                 mock_hook_conn,
+                                                 mock_hook_create_lambda, 
config):
+        operator = LambdaCreateFunctionOperator(
+            task_id="task_test",
+            function_name=FUNCTION_NAME,
+            role=ROLE_ARN,
+            code={
+                "ImageUri": IMAGE_URI,
+            },
+            config=config
+        )
+        operator.execute(None)
+
+        mock_hook_create_lambda.assert_called_once()
+        mock_hook_conn.get_waiter.assert_not_called()
+        assert operator.config.get("logging_config") == 
config.get("logging_config")
+        assert operator.config.get("architectures") == 
config.get("architectures")
+

Review Comment:
   Can you add cases for other configs like snap_start and ephemeral_storage as 
well?



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