Open lmmx opened 11 months ago
Thanks for opening your first issue here! We'll come back to you as soon as we can. In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link
Hello @lmmx! Thank you for opening this issue. I am currently reading this to respond to your points properly.
Hi @lmmx , thank you so much for bringing this issue to discussion, this is an important point.
Here in Powertools we do our best to make clear customer communication in every release we make and new features we add. We follow semantic versioning and therefore breaking changes are scheduled for major releases and even then with early and clear communication to our customers. That said, we've kept our layer with Pydanticv1 so that our users can upgrade to Pydanticv2 as often as they like, without forcing it and causing supply chain problems, as we experienced during the transition.
We are looking to add Pydantic V2 as our default in Powertools v3 - tentatively end of the year (https://docs.powertools.aws.dev/lambda/python/latest/roadmap/). Creating a new layer at this moment with unique support for Pydantic v2 adds more complexity to our process for maintaining and updating that layer. At this time, we are working hard to implement new features such as external observability providers and sensitive data masking.
To keep our eyes on the needs of the community, I added the need-customer-feedback
and revisit-in-3-months
labels - who knows, this might just be what other customers are looking for too.
Thanks.
Hey Leandro that's cool, I built a layer myself (it didn't take much effort) so this isn't urgent. I found a link to an AWS repo which linked to another one which had a Dockerfile, and I got a general idea of how to use rustup which is needed for Pydantic v2.
I suspect I actually end up installing Rust twice but it works so it's all good.
Python 3.10 layer Dockerfile is below, with apologies for any mess, in case it helps anyone else but I know you have your own superior CDK approach :smiley_cat:
Of course there are features in Powertools including Pydantic integration which go beyond Pydantic's base library, so I'm still looking forward to the managed layer.
Hello @lmmx! Wow, this Dockfile is priceless!! I'm going to copy and save it because I might need it soon to create some tests. Thank you so much for sharing this.
Yes, we are working to merge the existing PR and start working on the V3 plan as next steps.
I'll update this issue in case of news, ok?
Thanks
Use case
I saw that there was support coming for Pydantic v2 in lambda powertools:
1558
2733
but it seems like it is only support, not incorporation into the library dependencies (i.e. the library is not bumping to v2). This conflicts with the desired workflow of using new versions of the layer in combination with up to date Pydantic models.
Solution/User Experience
Will you consider publishing managed layers with v2 of Pydantic as the dependency?
This seems in line with the linked 'Tenet' of adopting best practices:
It could also be done in a backward compatible way if it was published with a separate ARN
It also relates to 'following language idioms and community common practices':
Alternative solutions
No response
Acknowledgment