-
Notifications
You must be signed in to change notification settings - Fork 421
feat(batch): reduce boilerplate with process_partial_response #2090
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
feat(batch): reduce boilerplate with process_partial_response #2090
Conversation
Converting to Draft as I still need to work on a doc revamp ;) PS: check this out @BakasuraRCE, I'm sure you'll enjoy the new slim DX. |
replace all examples with batch_processor with process_partial_response and its async equivalent. renamed 'As a decorator' code sections to make it explicitly legacy. add new section 'Recommended' using the new behaviour fixed all incorrect Pydantic examples while replacing batch_processor
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #2090 +/- ##
===========================================
+ Coverage 97.45% 97.46% +0.01%
===========================================
Files 146 147 +1
Lines 6748 6781 +33
Branches 477 478 +1
===========================================
+ Hits 6576 6609 +33
Misses 136 136
Partials 36 36
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
* develop: fix(batch): handle early validation errors for pydantic models (poison pill) aws-powertools#2091 (aws-powertools#2099) update changelog with latest changes docs(homepage): remove banner for end-of-support v1 (aws-powertools#2098) chore(deps-dev): bump aws-cdk-lib from 2.72.1 to 2.73.0 (aws-powertools#2097) chore(deps-dev): bump filelock from 3.10.7 to 3.11.0 (aws-powertools#2094) chore(deps-dev): bump coverage from 7.2.2 to 7.2.3 (aws-powertools#2092) chore(deps-dev): bump aws-cdk from 2.72.1 to 2.73.0 (aws-powertools#2093) chore(deps-dev): bump mypy-boto3-cloudformation from 1.26.60 to 1.26.108 (aws-powertools#2095) Signed-off-by: heitorlessa <[email protected]>
93fa497
to
120aab9
Compare
Notes for maintainers: Additional tech debt paid
|
spoke to @leandrodamascena who's on public holiday today - approved to go. |
This is now released under 2.12.0 version! |
Issue number: #2083
Summary
New
process_partial_response
andasync_process_partial_response
higher level functions.Changes
Add two new higher-order functions to reduce boilerplate and make it less error-prone for new customers using Batch, where the additional return often cause confusion.
This addition has the added benefit of reducing decorators therefore call stacks too (more memory/CPU efficient).
User experience
Before
After
Async
Checklist
If your change doesn't seem to apply, please leave them unchecked.
batch_processor
withprocess_partial_response
async_batch_processor
withasync_process_partial_response
.response()
batch_processor
andasync_batch_processor
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.