uranusjr commented on code in PR #27778:
URL: https://github.com/apache/airflow/pull/27778#discussion_r1031930667
##########
airflow/providers/amazon/aws/hooks/lambda_function.py:
##########
@@ -93,6 +93,12 @@ def create_lambda(
code_signing_config_arn: str | None = None,
architectures: list[str] | None = None,
) -> dict:
+ if package_type == "Zip":
+ if handler is None:
+ raise ValueError("Parameter 'handler' is required if
'package_type' is 'Zip'")
+ if runtime is None:
+ raise ValueError("Parameter 'runtime' is required if
'package_type' is 'Zip'")
Review Comment:
These should be TypeError to mirror Python’s default behaviour.
```pycon
>>> def f(*, a): pass
...
>>> f()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: f() missing 1 required keyword-only argument: 'a'
```
--
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]