-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Support raise_on_no_idempotency_key
for idempotent_function
#1663
Comments
Hey @dmwesterhoff could you post the full stack trace, please? That seems like an issue actually more than a feature request - a full error will help speed up the diagnostics tomorrow. Thanks a lot for flagging this!! |
It's a bug! It was meant to be a guard against a keyword argument not being present (L137). This should be a check on whether the data kwarg exists in kwargs - accidentally, this is getting the value, and checking if it's falsy. This means even key=False would fail here (no good!). As it's late here (8:48pm), I can make the fix tomorrow and cut a release with other merged enhancements -- if you have the bandwidth, please feel free to send a PR and I can review & expedite tomorrow. |
@leandrodamascena need your review to this bugfix PR to add to today's release. |
|
This is now released under 2.1.0 version! |
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. |
Use case
Trying to use
idempotent_function
in an "optional" manner. Example:When called like
echo(key=None)
will raiseRuntimeError
, even whenraise_on_no_idempotency_key
is set to FalseSolution/User Experience
Unless there is good reason not to respect the
IdempotencyConfig.raise_on_no_idempotency_key
value. Perhaps adding a similar parameter toidempotent_function
likeraise_on_no_data_keyword_argument
or something to that effect.Alternative solutions
No response
Acknowledgment
The text was updated successfully, but these errors were encountered: