Skip to content

Commit

Permalink
chore(deps): bump pydantic from 2.9.2 to 2.10.0 (#5611)
Browse files Browse the repository at this point in the history
* chore(deps): bump pydantic from 2.9.2 to 2.10.0

Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.9.2 to 2.10.0.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](pydantic/pydantic@v2.9.2...v2.10.0)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Fix models + make mypy happy

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Leandro Damascena <[email protected]>
dependabot[bot] and leandrodamascena authored Nov 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 9768b51 commit 6ccc140
Showing 7 changed files with 123 additions and 110 deletions.
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ class CloudWatchLogsDecode(BaseModel):


class CloudWatchLogsData(BaseModel):
decoded_data: CloudWatchLogsDecode = Field(None, alias="data")
decoded_data: CloudWatchLogsDecode = Field(..., alias="data")

@field_validator("decoded_data", mode="before")
def prepare_data(cls, value):
6 changes: 4 additions & 2 deletions aws_lambda_powertools/utilities/parser/models/event_bridge.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
from datetime import datetime
from typing import List, Optional

from pydantic import BaseModel, Field
from pydantic import BaseModel, ConfigDict, Field

from aws_lambda_powertools.utilities.parser.types import RawDictOrModel


class EventBridgeModel(BaseModel):
model_config = ConfigDict(populate_by_name=True)

version: str
id: str # noqa: A003,VNE003
source: str
account: str
time: datetime
region: str
resources: List[str]
detail_type: str = Field(None, alias="detail-type")
detail_type: str = Field(..., alias="detail-type")
detail: RawDictOrModel
replay_name: Optional[str] = Field(None, alias="replay-name")
10 changes: 5 additions & 5 deletions aws_lambda_powertools/utilities/parser/models/s3.py
Original file line number Diff line number Diff line change
@@ -27,8 +27,8 @@ class S3RequestParameters(BaseModel):


class S3ResponseElements(BaseModel):
x_amz_request_id: str = Field(None, alias="x-amz-request-id")
x_amz_id_2: str = Field(None, alias="x-amz-id-2")
x_amz_request_id: str = Field(..., alias="x-amz-request-id")
x_amz_id_2: str = Field(..., alias="x-amz-id-2")


class S3OwnerIdentify(BaseModel):
@@ -60,7 +60,7 @@ class S3EventNotificationObjectModel(BaseModel):
key: str
size: Optional[NonNegativeFloat] = None
etag: str = Field(default="")
version_id: str = Field(None, alias="version-id")
version_id: Optional[str] = Field(None, alias="version-id")
sequencer: Optional[str] = None


@@ -72,9 +72,9 @@ class S3EventNotificationEventBridgeDetailModel(BaseModel):
version: str
bucket: S3EventNotificationEventBridgeBucketModel
object: S3EventNotificationObjectModel # noqa: A003,VNE003
request_id: str = Field(None, alias="request-id")
request_id: str = Field(..., alias="request-id")
requester: str
source_ip_address: str = Field(None, alias="source-ip-address")
source_ip_address: Optional[str] = Field(None, alias="source-ip-address")
reason: Optional[str] = None
deletion_type: Optional[str] = Field(None, alias="deletion-type")
restore_expiry_time: Optional[str] = Field(None, alias="restore-expiry-time")
2 changes: 1 addition & 1 deletion aws_lambda_powertools/utilities/parser/models/ses.py
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ class SesMailHeaders(BaseModel):


class SesMailCommonHeaders(BaseModel):
header_from: List[str] = Field(None, alias="from")
header_from: List[str] = Field(..., alias="from")
to: List[str]
cc: Optional[List[str]] = None
bcc: Optional[List[str]] = None
Original file line number Diff line number Diff line change
@@ -39,4 +39,4 @@ class VpcLatticeV2Model(BaseModel):
query_string_parameters: Optional[Dict[str, str]] = Field(None, alias="queryStringParameters")
body: Optional[Union[str, Type[BaseModel]]] = None
is_base64_encoded: Optional[bool] = Field(None, alias="isBase64Encoded")
request_context: VpcLatticeV2RequestContext = Field(None, alias="requestContext")
request_context: VpcLatticeV2RequestContext = Field(..., alias="requestContext")
210 changes: 110 additions & 100 deletions poetry.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/functional/parser/test_parser.py
Original file line number Diff line number Diff line change
@@ -210,6 +210,7 @@ def test_parser_with_model_type_model_and_envelope():
source="source",
account="account",
time=datetime.now(),
detail_type="MyEvent",
region="region",
resources=[],
detail={"key": "value"},

0 comments on commit 6ccc140

Please sign in to comment.