uranusjr commented on a change in pull request #21686:
URL: https://github.com/apache/airflow/pull/21686#discussion_r810808306
##########
File path: airflow/providers/amazon/aws/hooks/lambda_function.py
##########
@@ -40,30 +41,84 @@ class LambdaHook(AwsBaseHook):
def __init__(
self,
- function_name: str,
- log_type: str = 'None',
- qualifier: str = '$LATEST',
- invocation_type: str = 'RequestResponse',
*args,
**kwargs,
) -> None:
- self.function_name = function_name
- self.log_type = log_type
- self.invocation_type = invocation_type
- self.qualifier = qualifier
kwargs["client_type"] = "lambda"
super().__init__(*args, **kwargs)
- def invoke_lambda(self, payload: str) -> str:
- """Invoke Lambda Function"""
- response = self.conn.invoke(
- FunctionName=self.function_name,
- InvocationType=self.invocation_type,
- LogType=self.log_type,
- Payload=payload,
- Qualifier=self.qualifier,
- )
+ def invoke_lambda(
+ self,
+ function_name: str,
+ invocation_type: Optional[str] = None,
+ log_type: Optional[str] = None,
+ client_context: Optional[str] = None,
+ payload: Optional[str] = None,
+ qualifier: Optional[str] = None,
+ ):
Review comment:
I do not suggest changing this to kwargs, but _keyword-only arguments_.
https://www.python.org/dev/peps/pep-3102/
--
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]