Skip to content

Commit 8a7e892

Browse files
Making Ruff happy
1 parent 546873b commit 8a7e892

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

aws_lambda_powertools/logging/formatter.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def formatTime(self, record: logging.LogRecord, datefmt: str | None = None) -> s
222222
# NOTE: Python `time.strftime` doesn't provide msec directives
223223
# so we create a custom one (%F) and replace logging record_ts
224224
# Reason 2 is that std logging doesn't support msec after TZ
225-
msecs = "%03d" % record.msecs
225+
msecs = "%03d" % record.msecs # noqa UP031
226226

227227
# Datetime format codes is a superset of time format codes
228228
# therefore we only honour them if explicitly asked
@@ -425,7 +425,9 @@ def _strip_none_records(records: dict[str, Any]) -> dict[str, Any]:
425425
RESERVED_FORMATTER_CUSTOM_KEYS: list[str] = inspect.getfullargspec(LambdaPowertoolsFormatter).args[1:]
426426

427427
# ContextVar for thread local keys
428-
THREAD_LOCAL_KEYS: ContextVar[dict[str, Any]] = ContextVar("THREAD_LOCAL_KEYS", default={})
428+
default_contextvar: dict[str, Any] = {}
429+
430+
THREAD_LOCAL_KEYS: ContextVar[dict[str, Any]] = ContextVar("THREAD_LOCAL_KEYS", default=default_contextvar)
429431

430432

431433
def _get_context() -> ContextVar[dict[str, Any]]:

0 commit comments

Comments
 (0)