Skip to content
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

Feature request: implement processPartialResponse wrapper function #1602

Closed
dreamorosi opened this issue Jul 11, 2023 · 2 comments · Fixed by #1605
Closed

Feature request: implement processPartialResponse wrapper function #1602

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

Use Case

The Batch Processing utility allows you to instantiate a class & then call a process() method within a for loop. To further reduce boilerplate code for those customers who don't need low-level control over the iteration and simply want to do something along the lines of for (const record of records) { await batch.process(record); }, we can provide a function wrapper.

Customers will have to wrap their processor function and pass the array of records to process, along with any config. The wrapper will take care of iterating over the batch and call the processor function.

Solution/User Experience

The Python version of Powertools for AWS doesn't have this feature, however you can use the implementation we have in this repo for Idempotency here, and its related types as loose reference of a wrapper function.

Acceptance criteria

  • The function wrapper allows all the use cases supported by the utility, except the ones that explicitly require low-level access to the iteration
  • The function and its types are exported
  • Unit tests are implemented with 100% coverage

Optional/stretch

  • Functions are documented via docstrings, following project's conventions as much as possible
@dreamorosi dreamorosi converted this from a draft issue Jul 11, 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 11, 2023
@erikayao93
Copy link
Contributor

I am starting implementation on this!

@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.

@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 13, 2023
@dreamorosi dreamorosi moved this from Coming soon to Shipped in Powertools for AWS Lambda (TypeScript) Jul 13, 2023
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
Development

Successfully merging a pull request may close this issue.

3 participants