Skip to content

Feature request: support accessing Lambda context in record handler #1607

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
dreamorosi opened this issue Jul 13, 2023 · 2 comments · Fixed by #1609
Closed

Feature request: support accessing Lambda context in record handler #1607

dreamorosi opened this issue Jul 13, 2023 · 2 comments · Fixed by #1609
Assignees
Labels
batch This item relates to the Batch Processing Utility completed This item is complete and has been merged/shipped feature-request This item refers to a feature request for an existing or new utility

Comments

@dreamorosi
Copy link
Contributor

dreamorosi commented Jul 13, 2023

Use Case

In the Python version of Powertools for AWS, when using Batch Processing and specifying a record handler customers can optionally configure the utility to pass the Lambda context to the record handler. This is useful in those cases in which the record handler needs to be aware of info from the context or needs to be able to retrieve the amount of time left before the function times out.

Solution/User Experience

Refer to the implementation described here.

In Python the feature is possible thanks to the existence of keyword arguments, customers can simply specify an argument named lambda_context in the record handler function and the Batch Processing utility will propagate the context from the function to it. In JS there's no notion of keyword arguments so we'll have to find an alternative solution. Proposals/ideas are welcome.

Acceptance criteria

  • Unit tests are implemented with 100% coverage
  • Added code is documented via docstrings, following project's conventions as much as possible
@dreamorosi dreamorosi converted this from a draft issue Jul 13, 2023
@dreamorosi dreamorosi added feature-request This item refers to a feature request for an existing or new utility confirmed The scope is clear, ready for implementation batch This item relates to the Batch Processing Utility labels Jul 13, 2023
@erikayao93
Copy link
Contributor

Picking up implementation on this!

@dreamorosi dreamorosi moved this from Backlog to Working on it in Powertools for AWS Lambda (TypeScript) Jul 13, 2023
@dreamorosi dreamorosi linked a pull request Jul 14, 2023 that will close this issue
9 tasks
@github-project-automation github-project-automation bot moved this from Working on it to Coming soon in Powertools for AWS Lambda (TypeScript) Jul 14, 2023
@dreamorosi dreamorosi added completed This item is complete and has been merged/shipped and removed confirmed The scope is clear, ready for implementation labels Jul 14, 2023
@dreamorosi dreamorosi moved this from Coming soon to Shipped in Powertools for AWS Lambda (TypeScript) Jul 14, 2023
@github-actions
Copy link
Contributor

⚠️ COMMENT VISIBILITY WARNING ⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
batch This item relates to the Batch Processing Utility completed This item is complete and has been merged/shipped feature-request This item refers to a feature request for an existing or new utility
Projects
2 participants