@@ -162,6 +162,7 @@ When using `idempotent_function`, you must tell us which keyword parameter in yo
162
162
def lambda_handler(event, context):
163
163
# `data` parameter must be called as a keyword argument to work
164
164
dummy("hello", "universe", data="test")
165
+ config.register_lambda_context(context) # see Lambda timeouts section
165
166
return processor.response()
166
167
```
167
168
@@ -198,7 +199,7 @@ When using `idempotent_function`, you must tell us which keyword parameter in yo
198
199
199
200
=== "dataclass_sample.py"
200
201
201
- ```python hl_lines="3-4 23 32 "
202
+ ```python hl_lines="3-4 23 33 "
202
203
from dataclasses import dataclass
203
204
204
205
from aws_lambda_powertools.utilities.idempotency import (
@@ -225,17 +226,18 @@ When using `idempotent_function`, you must tell us which keyword parameter in yo
225
226
def process_order(order: Order):
226
227
return f"processed order {order.order_id}"
227
228
229
+ def lambda_handler(event, context):
230
+ config.register_lambda_context(context) # see Lambda timeouts section
231
+ order_item = OrderItem(sku="fake", description="sample")
232
+ order = Order(item=order_item, order_id="fake-id")
228
233
229
- order_item = OrderItem(sku="fake", description="sample")
230
- order = Order(item=order_item, order_id="fake-id")
231
-
232
- # `order` parameter must be called as a keyword argument to work
233
- process_order(order=order)
234
+ # `order` parameter must be called as a keyword argument to work
235
+ process_order(order=order)
234
236
```
235
237
236
238
=== "parser_pydantic_sample.py"
237
239
238
- ```python hl_lines="1-2 22 31 "
240
+ ```python hl_lines="1-2 22 32 "
239
241
from aws_lambda_powertools.utilities.idempotency import (
240
242
DynamoDBPersistenceLayer, IdempotencyConfig, idempotent_function)
241
243
from aws_lambda_powertools.utilities.parser import BaseModel
@@ -261,12 +263,13 @@ When using `idempotent_function`, you must tell us which keyword parameter in yo
261
263
def process_order(order: Order):
262
264
return f"processed order {order.order_id}"
263
265
266
+ def lambda_handler(event, context):
267
+ config.register_lambda_context(context) # see Lambda timeouts section
268
+ order_item = OrderItem(sku="fake", description="sample")
269
+ order = Order(item=order_item, order_id="fake-id")
264
270
265
- order_item = OrderItem(sku="fake", description="sample")
266
- order = Order(item=order_item, order_id="fake-id")
267
-
268
- # `order` parameter must be called as a keyword argument to work
269
- process_order(order=order)
271
+ # `order` parameter must be called as a keyword argument to work
272
+ process_order(order=order)
270
273
```
271
274
272
275
### Choosing a payload subset for idempotency
0 commit comments