Computation of idempotency hash key using unqualified name
See original GitHub issueExpected Behaviour
The idempotency layer should be using the fully qualified name of the input function to compute the hash key. Using unqualified names may result in two distinct functions and/or methods contending for the same set of idempotency items.
Current Behaviour
In IdempotencyHandler, line 77:
persistence_store.configure(config, self.function.__name__)
Possible Solution
persistence_store.configure(config, self.function.__qualname__)
Note that it should be checked whether __qualname__
is subject to Python module import peculiarities. In particular, whether import module
and from module import funcName
yield the same __qualname__
.
Steps to Reproduce
class A:
@idempotent_function
def test(self, myParam):
return myParam
class B(A):
@idempotent_function
def test(self, myParam):
return myParam
AWS Lambda Powertools for Python version
latest
AWS Lambda function runtime
3.9
Packaging format used
PyPi
Debugging logs
No response
Issue Analytics
- State:
- Created a year ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Handling Lambda functions idempotency with ... - AWS
Idempotency is the property of an operation whereby it can be applied multiple times without changing the result beyond the initial application.
Read more >Idempotency - Lambda Powertools Python
Idempotency key is a hash representation of either the entire event or a specific configured subset of the event, and invocation results are ......
Read more >Method: jobs.query | BigQuery - Google Cloud
Specifies the default datasetId and projectId to assume for any unqualified table names in the query. If not set, all table names in...
Read more >Groovy Language Documentation
2, When we try to fetch the value with a String key, we will not find it, ... Conveniently for exact decimal number...
Read more >perlapi - autogenerated documentation for the perl public API
Delete a key and its associated value from the cop hints hash cophh, ... The name must be unqualified; that is, it must...
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
@heitorlessa I’d be pleased to contribute. Feel free to assign to me; I shall have a go at it in the coming days 😃
Thank you both, that’s super helpful. I agree in including the module as that will cover cases where people use the new typing.Protocol as well as traditional ABC interfaces.
@dispyfree would you like to do the honour and contribute the fix today?
We want to make a release today with this fix.
PS: @dispyfree I’m stoked you’re an avid customer. I’d love to hear more from you one of these days ❤️