Skip to content

Commit cc11c0f

Browse files
authored
ref(metrics): Improve type hints for set metrics (#3048)
Remove MetricValue from the set metric's value type hint. MetricValue is a union that includes floatwhich is correct based on how other parts of the code uses MetricValue. However, as floats are intentionally floored for set metrics, the current type hint might be confusing for a user as it looks like floats would work as unique values in a set. Fixes GH-3038
1 parent 40746ef commit cc11c0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sentry_sdk/metrics.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ def distribution(
926926

927927
def set(
928928
key, # type: str
929-
value, # type: MetricValue
929+
value, # type: Union[int, str]
930930
unit="none", # type: MeasurementUnit
931931
tags=None, # type: Optional[MetricTags]
932932
timestamp=None, # type: Optional[Union[float, datetime]]

0 commit comments

Comments
 (0)