Skip to content

Commit ffe8e00

Browse files
Addressing Heitor's feedback
1 parent a88f920 commit ffe8e00

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

aws_lambda_powertools/utilities/idempotency/idempotency.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from aws_lambda_powertools.middleware_factory import lambda_handler_decorator
1313
from aws_lambda_powertools.shared import constants
14-
from aws_lambda_powertools.shared.functions import powertools_dev_is_set, strtobool
14+
from aws_lambda_powertools.shared.functions import strtobool
1515
from aws_lambda_powertools.shared.types import AnyCallableT
1616
from aws_lambda_powertools.utilities.idempotency.base import IdempotencyHandler
1717
from aws_lambda_powertools.utilities.idempotency.config import IdempotencyConfig
@@ -72,13 +72,12 @@ def idempotent(
7272
# Skip idempotency controls when POWERTOOLS_IDEMPOTENCY_DISABLED has a truthy value
7373
# Raises a warning if not running in development mode
7474
if strtobool(os.getenv(constants.IDEMPOTENCY_DISABLED_ENV, "false")):
75-
if not powertools_dev_is_set():
76-
warnings.warn(
77-
message="Disabling idempotency is intended for development environments only "
78-
"and should not be used in production.",
79-
category=PowertoolsUserWarning,
80-
stacklevel=2,
81-
)
75+
warnings.warn(
76+
message="Disabling idempotency is intended for development environments only "
77+
"and should not be used in production.",
78+
category=PowertoolsUserWarning,
79+
stacklevel=2,
80+
)
8281
return handler(event, context, **kwargs)
8382

8483
config = config or IdempotencyConfig()
@@ -165,13 +164,12 @@ def decorate(*args, **kwargs):
165164
# Skip idempotency controls when POWERTOOLS_IDEMPOTENCY_DISABLED has a truthy value
166165
# Raises a warning if not running in development mode
167166
if strtobool(os.getenv(constants.IDEMPOTENCY_DISABLED_ENV, "false")):
168-
if not powertools_dev_is_set():
169-
warnings.warn(
170-
message="Disabling idempotency is intended for development environments only "
171-
"and should not be used in production.",
172-
category=PowertoolsUserWarning,
173-
stacklevel=2,
174-
)
167+
warnings.warn(
168+
message="Disabling idempotency is intended for development environments only "
169+
"and should not be used in production.",
170+
category=PowertoolsUserWarning,
171+
stacklevel=2,
172+
)
175173
return function(*args, **kwargs)
176174

177175
if data_keyword_argument not in kwargs:

0 commit comments

Comments
 (0)