Skip to content

Commit c711d9a

Browse files
Updating uograde guide
1 parent cd32fb4 commit c711d9a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/upgrade.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ We've made minimal breaking changes to make your transition to v3 as smooth as p
1717
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | -------------------- |
1818
| **Pydantic** | We have removed support for [Pydantic v1](#drop-support-for-pydantic-v1) | No |
1919
| **Parser** | We have replaced [DynamoDBStreamModel](#dynamodbstreammodel-in-parser) `AttributeValue` with native Python types | Yes |
20+
| **Parser** | We no longer export [Pydantic objects](#importing-pydantic-objects) from `parser.pydantic`. | Yes |
2021
| **Lambda layer** | [Lambda layers](#new-aws-lambda-layer-arns) are now compiled according to the specific Python version and architecture | No |
2122
| **Event Handler** | We [have deprecated](#event-handler-headers-are-case-insensitive) the `get_header_value` function. | Yes |
2223
| **Batch Processor** | `@batch_processor` and `@async_batch_processor` decorators [are now deprecated](#deprecated-batch-processing-decorators) | Yes |
@@ -91,6 +92,20 @@ def lambda_handler(event: DynamoDBStreamModel, context: LambdaContext):
9192

9293
```
9394

95+
## Importing Pydantic objects
96+
97+
We have stopped exporting Pydantic objects directly from `aws_lambda_powertools.utilities.parser.pydantic` to prevent potential confusion caused by Pydantic V2's significant changes in type, class, and method exports.
98+
99+
This change prevents customers from accidentally importing all of Pydantic, which could significantly slow down function startup times.
100+
101+
```diff
102+
- #BEFORE - v2
103+
- from aws_lambda_powertools.utilities.parser.pydantic import EmailStr
104+
105+
+ # NOW - v3
106+
+ from pydantic import EmailStr
107+
```
108+
94109
## New AWS Lambda Layer ARNs
95110

96111
!!! note "No code changes required"

0 commit comments

Comments
 (0)