lambda-warmer-py icon indicating copy to clipboard operation
lambda-warmer-py copied to clipboard

Error on lambdas that get List of events

Open giducko opened this issue 2 years ago • 0 comments

I am using lambda warmers on lambda functions that are connected as resolvers to AWS AppSync (graphql) AppSync has a feature that enables batches for a lambda function (resolver), resulting in a List of events. Therefore we receive this error when the invocation is not a warmer invocation.

@functools.wraps(f)
def wrapped_func(event, context, *args, **kwargs):

    execution_info = dict(
        instance_id=context.aws_request_id,
        is_warmer_invocation=event.get(flag) or False,
        **LAMBDA_INFO
    )
  AttributeError: 'list' object has no attribute 'get'

../../../.venv/lib/python3.9/site-packages/lambdawarmer/init.py:34: AttributeError

giducko avatar Jun 12 '23 11:06 giducko