Skip to content

Commit f548f56

Browse files
Merge branch 'develop' into docs/idempotency-guarantees
2 parents 6a0364d + 1554019 commit f548f56

File tree

12 files changed

+112
-30
lines changed

12 files changed

+112
-30
lines changed

.github/workflows/secure_workflows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Checkout code
3333
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3434
- name: Ensure 3rd party workflows have SHA pinned
35-
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@74606c30450304eee8660aae751818321754feb1 # v3.0.9
35+
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@b88cd0aad2c36a63e42c71f81cb1958fed95ac87 # v3.0.10
3636
with:
3737
allowlist: |
3838
slsa-framework/slsa-github-generator

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66

77
## Maintenance
88

9+
* **ci:** new pre-release 2.40.2a0 ([#4665](https://github.com/aws-powertools/powertools-lambda-python/issues/4665))
10+
* **deps:** bump the layer-balancer group in /layer/scripts/layer-balancer with 3 updates ([#4659](https://github.com/aws-powertools/powertools-lambda-python/issues/4659))
11+
* **deps-dev:** bump aws-cdk-aws-lambda-python-alpha from 2.147.1a0 to 2.147.2a0 ([#4667](https://github.com/aws-powertools/powertools-lambda-python/issues/4667))
12+
* **deps-dev:** bump aws-cdk-lib from 2.147.1 to 2.147.2 ([#4661](https://github.com/aws-powertools/powertools-lambda-python/issues/4661))
13+
* **deps-dev:** bump aws-cdk from 2.147.1 to 2.147.2 ([#4657](https://github.com/aws-powertools/powertools-lambda-python/issues/4657))
914
* **deps-dev:** bump ruff from 0.4.10 to 0.5.0 ([#4644](https://github.com/aws-powertools/powertools-lambda-python/issues/4644))
15+
* **deps-dev:** bump cdklabs-generative-ai-cdk-constructs from 0.1.198 to 0.1.199 ([#4668](https://github.com/aws-powertools/powertools-lambda-python/issues/4668))
16+
* **deps-dev:** bump cfn-lint from 1.4.1 to 1.4.2 ([#4660](https://github.com/aws-powertools/powertools-lambda-python/issues/4660))
1017

1118

1219
<a name="v2.40.1"></a>

aws_lambda_powertools/event_handler/openapi/encoders.py

+18-2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def jsonable_encoder( # noqa: PLR0911
9494
exclude_unset=exclude_unset,
9595
exclude_defaults=exclude_defaults,
9696
exclude_none=exclude_none,
97+
custom_serializer=custom_serializer,
9798
)
9899

99100
# Enums
@@ -115,8 +116,9 @@ def jsonable_encoder( # noqa: PLR0911
115116
include=include,
116117
exclude=exclude,
117118
by_alias=by_alias,
118-
exclude_none=exclude_none,
119119
exclude_unset=exclude_unset,
120+
exclude_none=exclude_none,
121+
custom_serializer=custom_serializer,
120122
)
121123

122124
# Sequences
@@ -129,6 +131,7 @@ def jsonable_encoder( # noqa: PLR0911
129131
exclude_none=exclude_none,
130132
exclude_defaults=exclude_defaults,
131133
exclude_unset=exclude_unset,
134+
custom_serializer=custom_serializer,
132135
)
133136

134137
# Other types
@@ -152,6 +155,7 @@ def jsonable_encoder( # noqa: PLR0911
152155
exclude_none=exclude_none,
153156
exclude_unset=exclude_unset,
154157
exclude_defaults=exclude_defaults,
158+
custom_serializer=custom_serializer,
155159
)
156160
except ValueError as exc:
157161
raise SerializationError(
@@ -201,9 +205,15 @@ def _dump_dict(
201205
by_alias: bool = True,
202206
exclude_unset: bool = False,
203207
exclude_none: bool = False,
208+
custom_serializer: Optional[Callable[[Any], str]] = None,
204209
) -> Dict[str, Any]:
205210
"""
206211
Dump a dict to a dict, using the same parameters as jsonable_encoder
212+
213+
Parameters
214+
----------
215+
custom_serializer : Callable, optional
216+
A custom serializer to use for encoding the object, when everything else fails.
207217
"""
208218
encoded_dict = {}
209219
allowed_keys = set(obj.keys())
@@ -222,12 +232,14 @@ def _dump_dict(
222232
by_alias=by_alias,
223233
exclude_unset=exclude_unset,
224234
exclude_none=exclude_none,
235+
custom_serializer=custom_serializer,
225236
)
226237
encoded_value = jsonable_encoder(
227238
value,
228239
by_alias=by_alias,
229240
exclude_unset=exclude_unset,
230241
exclude_none=exclude_none,
242+
custom_serializer=custom_serializer,
231243
)
232244
encoded_dict[encoded_key] = encoded_value
233245
return encoded_dict
@@ -242,9 +254,10 @@ def _dump_sequence(
242254
exclude_unset: bool = False,
243255
exclude_none: bool = False,
244256
exclude_defaults: bool = False,
257+
custom_serializer: Optional[Callable[[Any], str]] = None,
245258
) -> List[Any]:
246259
"""
247-
Dump a sequence to a list, using the same parameters as jsonable_encoder
260+
Dump a sequence to a list, using the same parameters as jsonable_encoder.
248261
"""
249262
encoded_list = []
250263
for item in obj:
@@ -257,6 +270,7 @@ def _dump_sequence(
257270
exclude_unset=exclude_unset,
258271
exclude_defaults=exclude_defaults,
259272
exclude_none=exclude_none,
273+
custom_serializer=custom_serializer,
260274
),
261275
)
262276
return encoded_list
@@ -271,6 +285,7 @@ def _dump_other(
271285
exclude_unset: bool = False,
272286
exclude_none: bool = False,
273287
exclude_defaults: bool = False,
288+
custom_serializer: Optional[Callable[[Any], str]] = None,
274289
) -> Any:
275290
"""
276291
Dump an object to a hashable object, using the same parameters as jsonable_encoder
@@ -292,6 +307,7 @@ def _dump_other(
292307
exclude_unset=exclude_unset,
293308
exclude_defaults=exclude_defaults,
294309
exclude_none=exclude_none,
310+
custom_serializer=custom_serializer,
295311
)
296312

297313

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Exposes version constant to avoid circular dependencies."""
22

3-
VERSION = "2.40.1"
3+
VERSION = "2.40.2a1"

noxfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def test_with_aws_encryption_sdk_as_required_package(session: nox.Session):
148148

149149

150150
@nox.session()
151-
@nox.parametrize("pydantic", ["1.10", "2.0"])
151+
@nox.parametrize("pydantic", ["1.10,<2.0", "2.0"])
152152
def test_with_pydantic_required_package(session: nox.Session, pydantic: str):
153153
"""Tests that only depends for Pydantic library v1 and v2"""
154154
# Event Handler OpenAPI

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "aws-lambda-powertools-python-e2e",
33
"version": "1.0.0",
44
"devDependencies": {
5-
"aws-cdk": "^2.147.2"
5+
"aws-cdk": "^2.147.3"
66
},
77
"dependencies": {
88
"package-lock.json": "^1.0.0"

poetry.lock

+15-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)