You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing a function with zappa.async.run in a non lambda environment an error is raised. This seems to happen due to the fact that zappa tries to run the function in the lambda environment even if it's not in the lambda environment. When using the @task decorator this works as expected since there is a direct invokation of the function if AWS_LAMBDA_FUNCTION_NAME env variable is not present.
Expected Behavior
The function should be invoked directly, without errors, in a non lambda environment.
Actual Behavior
The function fails with error
Invalid type for parameter FunctionName, value: None, type: <class 'NoneType'>, valid types: <class 'str'>
if (service in ASYNC_CLASSES) and (lambda_function_name):
send_result = ASYNC_CLASSES[service](lambda_function_name=lambda_function_name,
aws_region=aws_region,
capture_response=capture_response).send(task_path, args, kwargs)
return send_result
else: # For local exexution
return func(*args, **kwargs)
Your Environment
Zappa version used: 0.47.1
Operating System and Python version: 3.6
The text was updated successfully, but these errors were encountered:
Hi there! Unfortunately, this Issue has not seen any activity for at least 90 days. If the Issue is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.
Hi there! Unfortunately, this Issue was automatically closed as it had not seen any activity in at least 100 days. If the Issue is still relevant to the latest version of Zappa, please open a new Issue.
Originally from: Miserlou/Zappa#1774 by erback
Context
When executing a function with zappa.async.run in a non lambda environment an error is raised. This seems to happen due to the fact that zappa tries to run the function in the lambda environment even if it's not in the lambda environment. When using the @task decorator this works as expected since there is a direct invokation of the function if AWS_LAMBDA_FUNCTION_NAME env variable is not present.
Expected Behavior
The function should be invoked directly, without errors, in a non lambda environment.
Actual Behavior
The function fails with error
Possible Fix
Change this code: https://github.com/Miserlou/Zappa/blob/4cf80b2a0212a5a8111f0f66348b46ef39507ed1/zappa/async.py#L350
to
(copied from @task decorator)
Your Environment
The text was updated successfully, but these errors were encountered: