What were you searching in the docs?
I was looking into ways to combine Idempotency utility and Batch utility.
Is this related to an existing documentation section?
https://awslabs.github.io/aws-lambda-powertools-python/2.3.1/utilities/idempotency/#idempotent_function-decorator
How can we improve?
The code sample using batch_processor decorator has the following calling order, where save_inprogress is called before register_lambda_context is called.
batch_processor -> idempotent_function -> save_inprogress -> record_handler -> idempotent_function -> save_inprogress -> dummy -> register_lambda_context
Got a suggestion in mind?
Shouldn't we change to using context manager instead of decorator?
Also, shouldn't the dummy call be after register_lambda_context?
def handler(event, context):
config.register_lambda_context(context) # see Lambda timeouts section
# `data` parameter must be called as a keyword argument to work
dummy("hello", "universe", data="test")
batch = event["Records"]
with processor(records=batch, handler=record_handler):
processor.process()
return processor.response()
Acknowledgment
What were you searching in the docs?
I was looking into ways to combine Idempotency utility and Batch utility.
Is this related to an existing documentation section?
https://awslabs.github.io/aws-lambda-powertools-python/2.3.1/utilities/idempotency/#idempotent_function-decorator
How can we improve?
The code sample using
batch_processordecorator has the following calling order, wheresave_inprogressis called beforeregister_lambda_contextis called.batch_processor -> idempotent_function -> save_inprogress -> record_handler -> idempotent_function -> save_inprogress -> dummy -> register_lambda_context
Got a suggestion in mind?
Shouldn't we change to using context manager instead of decorator?
Also, shouldn't the dummy call be after register_lambda_context?
Acknowledgment