-
Notifications
You must be signed in to change notification settings - Fork 437
Description
Is this related to an existing feature request or issue?
Which Powertools for AWS Lambda (Python) utility does this relate to?
Other
Summary
We are excited to announce that we are starting a new major version (v3) for Powertools for AWS Lambda (Python). We are expediting a new major version to align with the scheduled Pydantic v1 end-of-life on June 30th, signalling the switch to much anticipated Pydantic v2. Pydantic plays a vital role and we care deeply about supply chain security. This release highlights our dedication to providing a secure and stable library that our customers trust.
Today, we already support both Pydantic v1 and v2. In this new major version, we will make Pydantic v2 the default, removing Pydantic v1. We will take this opportunity to introduce minor breaking changes to address common pain points. As always, we will provide an extensive upgrade guide to make this transition as smooth as possible.
Community
We invite the entire Powertools community, including users and contributors, to actively participate in this RFC. We greatly value the community's contribution, ideas, and willingness to solve problems or validate proposed changes.
Use case
The primary use case is to offer Pydantic v2. That includes a new Lambda Layer for each Python version since Pydantic v2 contains non-Python code (Rust). It future-proof Layers to contain any additional compiled dependency (like cryptography) without a new major version.
Additional key items on v3 backlog
- Distribute Lambda Layers in the AWS GovCloud regions
- Return sensible defaults over
Optional
in Event Source Data Classes to further reduce customers code - Remove deprecated code, deprecate legacy code to be removed in v4, and reduce API surface
Proposal
The action plan for this release with scope and tasks is as follows:
- Update our documentation to comply with our Versioning Policy and inform customers that we have started work on a new major version
- Create a branch named v3
- Make adjustments to our GitHub actions to run checks on this new branch
- Update Powertools v3 milestone to reflect current situation
- Address and resolve the issues mapped out for the execution of this launch plan.
- If possible, release early alpha versions for testing
Quick summary (Work in progress - Items can be added or removed):
- ✅ = done
- 🚧 = Work in progress
- 🚫 = Not considered in v3
Item | Issue/PR | Status | Code change required | Utility | Notes | Cross-Language |
---|---|---|---|---|---|---|
SSMProvider class to implement the get_multiple method |
#3252 | ✅ | Yes | Parameters | ||
Dict or List in Event Source Data Classes instead of None |
#2605 | ✅ | Yes | Event Source Data Class | ||
event_parser envelopes should handle unions of BaseModels |
#2734 | ✅ | No | Parser | ||
#2939 | ✅ | No | Layer | |||
Deprecate tracing.base.BaseProvider |
#4105 | 🚧 | No | Tracer | ||
resolved_headers_field is not Optional |
#4147 | ✅ | No | Event Source Data Class | ||
#3859 | ✅ | No | Layer | |||
Publish layer to Gov Cloud regions | #1166 | 🚧 | No | Layer | ✅ | |
#4191 | ✅ | Yes | Codebase | |||
#4198 | ✅ | No | Documentation | |||
aws-encryption-sdk dependency in the Powertools layer |
#4192 | ✅ | No | Layer | Depends on #3859 | |
extract_data_from_envelope in JMESPath Functions |
#4218 | ✅ | No | JMESPath Functions | ||
api_gateway.py file into several other files to ease maintenance |
#4194 | 🚫 | Yes | Event Handler | ||
#4220 | ✅ | No | CI | |||
Release the new version of Tracer utility with support for external providers | #2342 | 🚧 | Yes | Tracer | ||
DynamoDBStreamModel |
#4219 | ✅ | Yes | Parser | Reference: #1619 | ✅ |
- | 🚫 | Yes | Metrics | Needs discussion | ||
Keep the compatibility with Pydantic v2 and Bedrock agent resolver | #4196 | 🚧 | No | Event Handler | ||
#4193 | ✅ | Yes | Parameters | ✅ | ||
#4195 | ✅ | No | Dependencies | |||
Change behavior to fail batch on first error when using DynamoDB and Kinesis in batch processing | NEED ISSUE | 🚧 | Yes | Batch Processing | Reference: https://tinyurl.com/yc335m3s | ✅ |
log_uncaught_exceptions in the Logger utility |
#4199 | 🚫 | Yes | Logger | See: #1798 (comment) | |
Support for retrieving batch of secrets | #4200 | 🚧 | No | Parameters |
Deadlines
We plan to release the first version of v3 by the end of June/beginning of July.
Out of scope
We will not include in v3:
- Modularization to further reduce sizes
- Strict typing
- New utilities
Potential challenges
Adding Pydantic v2 in the Powertools layer requires layers per Python version, so the effort to implement this is not yet clear.
Dependencies and Integrations
No response
Alternative solutions
No response
Acknowledgment
- This feature request meetsShould this be considered in other Powertools for AWS Lambda languages? i.e. , , andTo pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Activity
jplock commentedon Apr 24, 2024
There's a lot of overlap between the Event Handler, Event Source Data Classes, Parser, and Validation
Is there a nice way to unify it all somehow?
ran-isenberg commentedon Apr 26, 2024
I agree. Since v3 will use pydantic by default, is there a need to maintain event source data classes? why not move to the parser's pydantic schemas exclusively? I suppose there are some gaps in coverage and missing schemas, but that can be fixed :)
Event handler/validation already support pydantic/parser schemas.
18 remaining items
Hatter1337 commentedon Sep 10, 2024
Thank you for advancing this product!
I hope this will be the start of improved OpenAPI autogeneration, making it as easy as in FastAPI 😄
leandrodamascena commentedon Sep 10, 2024
Hi @Hatter1337! Thanks for using Powertools and giving us some ideas on what you want to see we investing time into it. But I'm curious about this:
We already support OpenAPI generation in V2. The experience is simple and you just need to write down your routes and access swagger or generate OpenAPI JSON Schema.
https://docs.powertools.aws.dev/lambda/python/latest/core/event_handler/api_gateway/#openapi
Are you talking about something different? Any improvement? I'm really curious to hear from you.
Hatter1337 commentedon Sep 10, 2024
This might not be the best place for this discussion, but I’ll respond here...
I've been using Powertools for quite long time, and to be honest, I often end up writing the Swagger file manually, primarily because OpenAPI generation requires almost full descriptions:
All of this is in the same file as the business logic, making it quite bulky and harder to manage. I'm not sure how it's implemented in FastAPI, but there it seems much simpler 🙊
Occasionally, I run into certain issues, one of which I've described here. Another example is that I haven’t been able to find information on how to add something similar to this when using
app.enable_swagger
:Also, I prefer to split API endpoints across different Lambda functions - for example, having User CRUD in one Lambda function and authentication in another, rather than putting the entire API in a single Lambda function. However, with this approach, it's almost impossible to generate a unified OpenAPI/Swagger file for the whole API.
That said, I still believe Powertools is an amazing framework, and I'm grateful to everyone who contributed to its development. I hope I can also be helpful to the community in the future.
zerubeus commentedon Sep 19, 2024
Where can we find the new doc for V3?
github-actions commentedon Sep 23, 2024
This is now released under 3.0.0 version!