Skip to content

Commit a0f12c9

Browse files
Addressing Heitor's feedback
1 parent 896cd83 commit a0f12c9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

aws_lambda_powertools/utilities/idempotency/idempotency.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
BaseIdempotencySerializer,
2424
)
2525
from aws_lambda_powertools.utilities.typing import LambdaContext
26-
from aws_lambda_powertools.warnings import PowertoolsWarning
26+
from aws_lambda_powertools.warnings import PowertoolsUserWarning
2727

2828
logger = logging.getLogger(__name__)
2929

@@ -76,7 +76,7 @@ def idempotent(
7676
warnings.warn(
7777
message="Disabling idempotency is intended for development environments only "
7878
"and should not be used in production.",
79-
category=PowertoolsWarning,
79+
category=PowertoolsUserWarning,
8080
stacklevel=2,
8181
)
8282
return handler(event, context, **kwargs)
@@ -169,7 +169,7 @@ def decorate(*args, **kwargs):
169169
warnings.warn(
170170
message="Disabling idempotency is intended for development environments only "
171171
"and should not be used in production.",
172-
category=PowertoolsWarning,
172+
category=PowertoolsUserWarning,
173173
stacklevel=2,
174174
)
175175
return function(*args, **kwargs)

aws_lambda_powertools/warnings/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Shared warnings that don't belong to a single utility"""
22

33

4-
class PowertoolsWarning(UserWarning):
4+
class PowertoolsUserWarning(UserWarning):
55
"""
66
This class provides a custom Warning tailored for better clarity when certain situations occur.
77
It offers more informative and relevant warning messages, allowing customers to easily suppress

tests/functional/idempotency/test_idempotency.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
PydanticSerializer,
5252
)
5353
from aws_lambda_powertools.utilities.validation import envelopes, validator
54-
from aws_lambda_powertools.warnings import PowertoolsWarning
54+
from aws_lambda_powertools.warnings import PowertoolsUserWarning
5555
from tests.functional.idempotency.utils import (
5656
build_idempotency_put_item_response_stub,
5757
build_idempotency_put_item_stub,
@@ -1719,7 +1719,7 @@ def dummy(data):
17191719
def dummy_handler(event, context):
17201720
return {"message": "hi"}
17211721

1722-
with pytest.warns(PowertoolsWarning, match="Disabling idempotency is intended for development environments*"):
1722+
with pytest.warns(PowertoolsUserWarning, match="Disabling idempotency is intended for development environments*"):
17231723
dummy(data=mock_event)
17241724
dummy_handler(mock_event, lambda_context)
17251725

0 commit comments

Comments
 (0)