Skip to content

Feature request: implement processPartialResponse wrapper function #1602

Closed
@dreamorosi

Description

@dreamorosi

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

Metadata

Metadata

Assignees

Labels

batchThis item relates to the Batch Processing UtilitycompletedThis item is complete and has been merged/shippedfeature-requestThis item refers to a feature request for an existing or new utility

Type

No type

Projects

Status

Shipped

Relationships

None yet

Development

No branches or pull requests

Issue actions