v1.23.0 #916
Closed
heitorlessa
started this conversation in
Show and tell
v1.23.0
#916
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
This Christmas release was heavily focused on papercuts and two must needed improvements - Batch now supports SQS, DynamoDB, and Kinesis using the new native partial response (decreased cost), and Event Handler API Gateway now supports exception handling and overriding HTTP 404 errors.
For the next release, we're going to further invest in Mypy compliance, support native serialization of Python Dataclasses and Pydantic Models in Idempotency utility, and more!
New Batch Processor
A few weeks ago Lambda added native support for partial response. Since GA, Batch utility provided that capability to SQS by handling partial failures and deleting successful messages on your behalf.
With the new capability, we've added a new BatchProcessor that can process both SQS, Kinesis Data Streams, and DynamoDB Streams.
The new capability requires an infrastructure change in the Lambda Event Source Mapping hence why a new Batch Processor - We've made sure to add complete SAM examples for SQS, Kinesis, and DynamoDB Streams on everything you need to get going including minimal IAM permissions.
We also took this opportunity to a) provide tight integration with Event Source Data Classes for self-documented batch records, b) Parser (Pydantic) integration so you can bring your own models for data schema and validation, and c) mypy is fully compliant regardles of the event type or Pydantic model you bring.
Did I also say we refreshed the entire documentation with sample events, responses, how to unit test, and a Migration Guide?
Migration guide
If you were using
SQSBatchProcessor
before as a decorator or as a context manager, we've written a guide to help you transition to the new more performant and cost efficient way: https://awslabs.github.io/aws-lambda-powertools-python/develop/utilities/batch/#migration-guideA warm start with tracing, logging, data transformation, and exception handling can run as fast as 8ms end-to-end now.
Event Handler API Gateway improvements
Overriding 404 errors
You can now override how we handle unmatched routes (404) by using a decorator
not_found
. The experience is similar to how you'd define routes, except your function will receive an exception -NotFoundError
in this case.You can customize the response by simply returning
Response
like you would in a more advanced route -- This should give you more flexibility to generate metrics, log errors, or anything you might want for unmatched routes.Exception handling
Besides 404 errors, you might want to handle custom validation errors, or any exception you might raise as part of your route handling. You can now use
exception_handler
decorator and pass any valid Python Exception.Tracer
Tracer now automatically adds a
Service
annotation if eitherservice
parameter orPOWERTOOLS_SERVICE_NAME
is set - This makes it easier to slice and dice all of your traces by the exact service you have deployed.Moreover, we now include
ColdStart=false
for warm start invocations so you can more easily sample and analyze performance differences between cold and warm starts.CloudFormation Custom Resources
As our Java Powertools colleagues added a new utility for easily writing CloudFormation Custom Resources, we added a link in our docs pointing to the official Python library for crafting custom resources.... just in case it's not widely known: https://github.com/aws-cloudformation/custom-resource-helper
Changes
🌟New features and non-breaking changes
🌟 Minor Changes
📜 Documentation updates
🐛 Bug and hot fixes
🔧 Maintenance
This release was made possible by the following contributors:
@cakepietoast, @dependabot, @dependabot[bot], @heitorlessa, @michaelbrewer, @ran-isenberg and @whardier
Full Changelog: v1.22.0...v1.22.1
This discussion was created from the release v1.23.0.
Beta Was this translation helpful? Give feedback.
All reactions