Feature request: Support `raise_on_no_idempotency_key` for `idempotent_function`
See original GitHub issueUse case
Trying to use idempotent_function
in an “optional” manner. Example:
import random
@idemp_f(data_keyword_argument="key")
def echo(key: str = None):
return random.randint(1, 1000000)
When called like echo(key=None)
will raise RuntimeError
, even when raise_on_no_idempotency_key
is set to False
Solution/User Experience
Unless there is good reason not to respect the IdempotencyConfig.raise_on_no_idempotency_key
value. Perhaps adding a similar parameter to idempotent_function
like raise_on_no_data_keyword_argument
or something to that effect.
Alternative solutions
No response
Acknowledgment
- This feature request meets Lambda Powertools Tenets
- Should this be considered in other Lambda Powertools languages? i.e. Java, TypeScript
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Idempotent Requests - Stripe API reference
An idempotency key is a unique value generated by the client which the server uses to recognize subsequent retries of the same request....
Read more >[FEATURE REQUEST] support for idempotent API requests
Hi Kevin,. As a convention in REST APIs, POST requests are only used to create resources, not usually update, so I'm not sure...
Read more >Understanding why and how to add idempotent requests to ...
We want whenever a client of our APIs sends a request using a Idempotency-Key header to check if that key has been used...
Read more >Ensuring idempotency - Amazon Elastic Compute Cloud
Idempotency ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, ...
Read more >How to achieve idempotency in POST method? - Medium
Before I get into how to achieve idempotency in a POST request, I would like to explain what idempotent is, and the different...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry for late reply, just seeing this now – I was unsure of if this was unintended side effect (bug) or a feature 😃. Thanks for the swift resolution, much appreciated.
This is now released under 2.1.0 version!