Expected 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
Expected 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, whetherimport moduleandfrom module import funcNameyield the same__qualname__.Steps to Reproduce
AWS Lambda Powertools for Python version
latest
AWS Lambda function runtime
3.9
Packaging format used
PyPi
Debugging logs
No response