aws-lambda-powertools 2.40.2a0__py3-none-any.whl → 2.40.2a2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,6 +94,7 @@ def jsonable_encoder( # noqa: PLR0911
94
94
  exclude_unset=exclude_unset,
95
95
  exclude_defaults=exclude_defaults,
96
96
  exclude_none=exclude_none,
97
+ custom_serializer=custom_serializer,
97
98
  )
98
99
 
99
100
  # Enums
@@ -115,8 +116,9 @@ def jsonable_encoder( # noqa: PLR0911
115
116
  include=include,
116
117
  exclude=exclude,
117
118
  by_alias=by_alias,
118
- exclude_none=exclude_none,
119
119
  exclude_unset=exclude_unset,
120
+ exclude_none=exclude_none,
121
+ custom_serializer=custom_serializer,
120
122
  )
121
123
 
122
124
  # Sequences
@@ -129,6 +131,7 @@ def jsonable_encoder( # noqa: PLR0911
129
131
  exclude_none=exclude_none,
130
132
  exclude_defaults=exclude_defaults,
131
133
  exclude_unset=exclude_unset,
134
+ custom_serializer=custom_serializer,
132
135
  )
133
136
 
134
137
  # Other types
@@ -152,6 +155,7 @@ def jsonable_encoder( # noqa: PLR0911
152
155
  exclude_none=exclude_none,
153
156
  exclude_unset=exclude_unset,
154
157
  exclude_defaults=exclude_defaults,
158
+ custom_serializer=custom_serializer,
155
159
  )
156
160
  except ValueError as exc:
157
161
  raise SerializationError(
@@ -201,9 +205,15 @@ def _dump_dict(
201
205
  by_alias: bool = True,
202
206
  exclude_unset: bool = False,
203
207
  exclude_none: bool = False,
208
+ custom_serializer: Optional[Callable[[Any], str]] = None,
204
209
  ) -> Dict[str, Any]:
205
210
  """
206
211
  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.
207
217
  """
208
218
  encoded_dict = {}
209
219
  allowed_keys = set(obj.keys())
@@ -222,12 +232,14 @@ def _dump_dict(
222
232
  by_alias=by_alias,
223
233
  exclude_unset=exclude_unset,
224
234
  exclude_none=exclude_none,
235
+ custom_serializer=custom_serializer,
225
236
  )
226
237
  encoded_value = jsonable_encoder(
227
238
  value,
228
239
  by_alias=by_alias,
229
240
  exclude_unset=exclude_unset,
230
241
  exclude_none=exclude_none,
242
+ custom_serializer=custom_serializer,
231
243
  )
232
244
  encoded_dict[encoded_key] = encoded_value
233
245
  return encoded_dict
@@ -242,9 +254,10 @@ def _dump_sequence(
242
254
  exclude_unset: bool = False,
243
255
  exclude_none: bool = False,
244
256
  exclude_defaults: bool = False,
257
+ custom_serializer: Optional[Callable[[Any], str]] = None,
245
258
  ) -> List[Any]:
246
259
  """
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.
248
261
  """
249
262
  encoded_list = []
250
263
  for item in obj:
@@ -257,6 +270,7 @@ def _dump_sequence(
257
270
  exclude_unset=exclude_unset,
258
271
  exclude_defaults=exclude_defaults,
259
272
  exclude_none=exclude_none,
273
+ custom_serializer=custom_serializer,
260
274
  ),
261
275
  )
262
276
  return encoded_list
@@ -271,6 +285,7 @@ def _dump_other(
271
285
  exclude_unset: bool = False,
272
286
  exclude_none: bool = False,
273
287
  exclude_defaults: bool = False,
288
+ custom_serializer: Optional[Callable[[Any], str]] = None,
274
289
  ) -> Any:
275
290
  """
276
291
  Dump an object to a hashable object, using the same parameters as jsonable_encoder
@@ -292,6 +307,7 @@ def _dump_other(
292
307
  exclude_unset=exclude_unset,
293
308
  exclude_defaults=exclude_defaults,
294
309
  exclude_none=exclude_none,
310
+ custom_serializer=custom_serializer,
295
311
  )
296
312
 
297
313
 
@@ -1,3 +1,3 @@
1
1
  """Exposes version constant to avoid circular dependencies."""
2
2
 
3
- VERSION = "2.40.2a0"
3
+ VERSION = "2.40.2a2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aws-lambda-powertools
3
- Version: 2.40.2a0
3
+ Version: 2.40.2a2
4
4
  Summary: Powertools for AWS Lambda (Python) is a developer toolkit to implement Serverless best practices and increase developer velocity.
5
5
  Home-page: https://github.com/aws-powertools/powertools-lambda-python
6
6
  License: MIT
@@ -20,7 +20,7 @@ aws_lambda_powertools/event_handler/openapi/__init__.py,sha256=47DEQpj8HBSa-_TIm
20
20
  aws_lambda_powertools/event_handler/openapi/compat.py,sha256=YXmqtw7x7cOMZ6atGYi17lR_9KZSzXGjf5yLBkMUHsY,17987
21
21
  aws_lambda_powertools/event_handler/openapi/constants.py,sha256=uGF92NpuuUhmXXPsMZe1poFLaUmhdDdqTRZI6EBxR9w,64
22
22
  aws_lambda_powertools/event_handler/openapi/dependant.py,sha256=QF5zDsQE7eNonrdONuQqcdgU-AeK3nd1RuPrkt_KKIQ,12500
23
- aws_lambda_powertools/event_handler/openapi/encoders.py,sha256=eUjcZ_8dIvd-1dHu-rBc1jJUhA2ysi7U5At53S9VDhs,10984
23
+ aws_lambda_powertools/event_handler/openapi/encoders.py,sha256=_zHpjobqp-kqgaE4JELCZaI1ffnzbSC5N7kFX6xpMN0,11745
24
24
  aws_lambda_powertools/event_handler/openapi/exceptions.py,sha256=4iubuXydACTddytd3NMfqlwlS9aOXMSaROU7ev2Ojes,777
25
25
  aws_lambda_powertools/event_handler/openapi/models.py,sha256=Nf3QBRy73dIR0A8JbmrADUs1TVt2XU2hoHZL1a8np6g,17555
26
26
  aws_lambda_powertools/event_handler/openapi/params.py,sha256=14Haa13icCWyrT9wn1k5r4CA9XwLnF15XS_s9_72jc8,42838
@@ -83,7 +83,7 @@ aws_lambda_powertools/shared/json_encoder.py,sha256=4ILd4gE9RWqbbVyBAMDNDm0JgTpm
83
83
  aws_lambda_powertools/shared/lazy_import.py,sha256=3Jm_ng5lyTI97YAOCeliNDzlxG3gBwszJm0XHGfoQRA,2035
84
84
  aws_lambda_powertools/shared/types.py,sha256=qhpOtwND19KqATlXgSq0yWoca1fehv2uI2oL8B0U6jY,1007
85
85
  aws_lambda_powertools/shared/user_agent.py,sha256=DrCMFQuT4a4iIrpcWpAIjY37EFqR9-QxlxDGD-Nn9Gg,7081
86
- aws_lambda_powertools/shared/version.py,sha256=fMGWzAwSpN8ISgmLViW3tu4MbvTuUtpxQ0gM08XNEHs,85
86
+ aws_lambda_powertools/shared/version.py,sha256=o3mtk9xMwF7vEOVrfaFRAIK1QQPi4XFCSnGUmARQtUM,85
87
87
  aws_lambda_powertools/tracing/__init__.py,sha256=Zdk7mE8lUMICbYOnx_1yFjvghzoPOpPmRv-Wkj-kzkU,142
88
88
  aws_lambda_powertools/tracing/base.py,sha256=JysEH9j4_FSQeEAUnx6h43JeyUpLY9aBwxl9bqqEyYI,4390
89
89
  aws_lambda_powertools/tracing/extensions.py,sha256=APOfXOq-hRBKaK5WyfIyrd_6M1_9SWJZ3zxLA9jDZzU,492
@@ -239,7 +239,7 @@ aws_lambda_powertools/utilities/validation/envelopes.py,sha256=YD5HOFx6IClQgii0n
239
239
  aws_lambda_powertools/utilities/validation/exceptions.py,sha256=De_QLn5R4L1qxe4rhbxQNIZWRe6fbdrQS7vqlus6bC0,2047
240
240
  aws_lambda_powertools/utilities/validation/validator.py,sha256=iasiFp-NaBXK0h5qsXWdUKWmCNnGiAVARgUsX2zQtls,9900
241
241
  aws_lambda_powertools/warnings/__init__.py,sha256=1FuRsurql2xg1ovxI2gpfKcTcdcYyfLgEywapO6pzS4,618
242
- aws_lambda_powertools-2.40.2a0.dist-info/LICENSE,sha256=vMHS2eBgmwPUIMPb7LQ4p7ib_FPVQXarVjAasflrTwo,951
243
- aws_lambda_powertools-2.40.2a0.dist-info/METADATA,sha256=7gRAydt_Gg1F0dBWENRVwfe6shFLbOi4fx6KR749bPk,10806
244
- aws_lambda_powertools-2.40.2a0.dist-info/WHEEL,sha256=WGfLGfLX43Ei_YORXSnT54hxFygu34kMpcQdmgmEwCQ,88
245
- aws_lambda_powertools-2.40.2a0.dist-info/RECORD,,
242
+ aws_lambda_powertools-2.40.2a2.dist-info/LICENSE,sha256=vMHS2eBgmwPUIMPb7LQ4p7ib_FPVQXarVjAasflrTwo,951
243
+ aws_lambda_powertools-2.40.2a2.dist-info/METADATA,sha256=CaIOeVMpVodp-0mqGJFO15dXQ14tB0OkKHbQzW7ptiI,10806
244
+ aws_lambda_powertools-2.40.2a2.dist-info/WHEEL,sha256=WGfLGfLX43Ei_YORXSnT54hxFygu34kMpcQdmgmEwCQ,88
245
+ aws_lambda_powertools-2.40.2a2.dist-info/RECORD,,