Skip to content

Commit 10a5cf5

Browse files
refactor(metrics): Improve type annotations for metrics decorator (#6000)
Fix type annotation with metrics decorator
1 parent e8bcd98 commit 10a5cf5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

aws_lambda_powertools/metrics/metrics.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# NOTE: keeps for compatibility
22
from __future__ import annotations
33

4-
from typing import TYPE_CHECKING, Any
4+
from typing import TYPE_CHECKING, Any, Callable
55

66
from aws_lambda_powertools.metrics.provider.cloudwatch_emf.cloudwatch import AmazonCloudWatchEMFProvider
77

@@ -149,8 +149,8 @@ def log_metrics(
149149
capture_cold_start_metric: bool = False,
150150
raise_on_empty_metrics: bool = False,
151151
default_dimensions: dict[str, str] | None = None,
152-
**kwargs,
153-
):
152+
**kwargs: dict[str, Any],
153+
) -> Callable[..., Any]:
154154
return self.provider.log_metrics(
155155
lambda_handler=lambda_handler,
156156
capture_cold_start_metric=capture_cold_start_metric,

0 commit comments

Comments
 (0)