Skip to content

Feature request: implement BasePartialBatchProcessor class #1586

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 7, 2023 · 2 comments · Fixed by #1588
Closed

Feature request: implement BasePartialBatchProcessor class #1586

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

Use Case

The Python version of Powertools for AWS features a classes called BasePartialBatchProcessor and BatchProcessor, and its respective interfaces. These class is used to provide a Batch Processor utility in Powertools.

Solution/User Experience

Refer to the implementation found here, and specifically to the BasePartialBatchProcessor class and BasePartialProcessor interface.

Refer to the implementation found here, and specifically to the BatchProcessor class.

Acceptance criteria

  • The class covers all the features found in the reference implementation
  • The class and its type are exported
  • Unit tests are implemented and have 100% coverage
  • Classes and methods are documented via docstrings, following project's conventions as much as possible

Notes

The reference implementation also implements an AsyncBatchProcessor and both classes have _process_record and _async_process_record methods.

I'd like to dedicate some time investigating whether we can merge these two classes & methods into a single one.

The ideal DX would have the customer simply importing BatchProcessor and passing it a function reference when calling process_partial_response. The utility should be smart enough to understand whether the function passed is synchronous or asynchronous and handle it accordingly (i.e. if it's async, then await the record handler).

If this is not possible, or too complex / unreliable, or the resulting types are confusing or overly broad, then let's stick with two separate entities.

@dreamorosi dreamorosi converted this from a draft issue Jul 7, 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 7, 2023
@dreamorosi dreamorosi moved this from Backlog to Working on it in Powertools for AWS Lambda (TypeScript) Jul 7, 2023
@erikayao93
Copy link
Contributor

Just opened PR for this issue!

@dreamorosi dreamorosi linked a pull request Jul 7, 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 11, 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 11, 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.

@dreamorosi dreamorosi moved this from Coming soon to Shipped in Powertools for AWS Lambda (TypeScript) Jul 11, 2023
@am29d am29d added this to the Batch processing - Beta release milestone Jul 12, 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
3 participants