Skip to content

Commit 3301011

Browse files
committed
mypy
1 parent d87ae30 commit 3301011

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

sentry_sdk/_metrics.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
"""
55

66
import time
7-
from typing import Any, Optional, TYPE_CHECKING
7+
from typing import Any, Optional, TYPE_CHECKING, Union
88

99
import sentry_sdk
1010
from sentry_sdk.utils import safe_repr
1111

1212
if TYPE_CHECKING:
13-
from sentry_sdk._types import Metric
13+
from sentry_sdk._types import Metric, MetricType
1414

1515

1616
def _capture_metric(
1717
name, # type: str
18-
metric_type, # type: str
18+
metric_type, # type: MetricType
1919
value, # type: float
2020
unit=None, # type: Optional[str]
2121
attributes=None, # type: Optional[dict[str, Any]]

sentry_sdk/_metrics_batcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import random
33
import threading
44
from datetime import datetime, timezone
5-
from typing import Optional, List, Callable, TYPE_CHECKING, Any
5+
from typing import Optional, List, Callable, TYPE_CHECKING, Any, Union
66

77
from sentry_sdk.utils import format_timestamp, safe_repr
88
from sentry_sdk.envelope import Envelope, Item, PayloadRef

sentry_sdk/_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ class SDKInfo(TypedDict):
254254
"type": MetricType,
255255
"value": float,
256256
"unit": Optional[str],
257-
"attributes": dict[str, MetricAttributeValue],
257+
"attributes": dict[str, str | bool | float | int],
258258
},
259259
)
260260

sentry_sdk/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
from sentry_sdk.spotlight import SpotlightClient
6969
from sentry_sdk.transport import Transport
7070
from sentry_sdk._log_batcher import LogBatcher
71+
from sentry_sdk._metrics_batcher import MetricsBatcher
7172

7273
I = TypeVar("I", bound=Integration) # noqa: E741
7374

sentry_sdk/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
from gevent.hub import Hub
6161

62-
from sentry_sdk._types import Event, ExcInfo, Log, Hint
62+
from sentry_sdk._types import Event, ExcInfo, Log, Hint, Metric
6363

6464
P = ParamSpec("P")
6565
R = TypeVar("R")

0 commit comments

Comments
 (0)