question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Support `raise_on_no_idempotency_key` for `idempotent_function`

See original GitHub issue

Use 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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dmwesterhoffcommented, Nov 2, 2022

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.

0reactions
github-actions[bot]commented, Oct 31, 2022

This is now released under 2.1.0 version!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found