Skip to content

Bug: Unable to inject lambda context in handler with additional arguments #1277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RonRademaker opened this issue Jul 4, 2022 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@RonRademaker
Copy link
Contributor

Expected Behaviour

Possible to decorate a lambda handler with additional arguments with @logger.inject_lambda_context

Current Behaviour

TypeError: decorate() takes 2 positional arguments but 3 were given

Code snippet

@logger.inject_lambda_context
def handler(event, context, planet, str_end="."):
    logger.info(f"Hello {planet}{str_end}")


### Possible Solution

See https://github.com/awslabs/aws-lambda-powertools-python/pull/1276

### Steps to Reproduce

See code snippet

### AWS Lambda Powertools for Python version

latest

### AWS Lambda function runtime

3.9

### Packaging format used

PyPi

### Debugging logs

_No response_
@RonRademaker RonRademaker added bug Something isn't working triage Pending triage from maintainers labels Jul 4, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Jul 4, 2022

Thanks for opening your first issue here! We'll come back to you as soon as we can.

@heitorlessa heitorlessa added pending-release Fix or implementation already in dev waiting to be released and removed triage Pending triage from maintainers labels Jul 4, 2022
@heitorlessa
Copy link
Contributor

Thank you @RonRademaker ! This should be out by EOD, aiming at releasing in the afternoon after another fix is done

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2022

This is now released under 1.26.3 version!

@github-actions github-actions bot closed this as completed Jul 4, 2022
@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Jul 4, 2022
@heitorlessa
Copy link
Contributor

hey @RonRademaker it's now on PyPi. Lambda Layers should be out in a few hours for all AWS commercial regions. Thank you again ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants