schirag1993 commented on a change in pull request #21686:
URL: https://github.com/apache/airflow/pull/21686#discussion_r810755842
##########
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:
Hello @uranusjr, these were originally kwargs. However, based on
@malthe's feedback
(https://github.com/apache/airflow/pull/21686#discussion_r810589155) from an
earlier discussion (which I agree with), it may be difficult for first timers
to understand what is required and the typing info helps as well.
As we are building this for Airflow, it makes sense to spell out these
parameters for users for better reference.
What are your thoughts? If the above does not make sense, I'll go ahead and
make the required changes.
--
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]