From 927903e3b354a42e427d91129c399d64d480a6b9 Mon Sep 17 00:00:00 2001 From: Ogaday Date: Fri, 16 Apr 2021 17:41:16 +0100 Subject: [PATCH] Update traces_sampler declaration to concrete types (#1091) Fixes getsentry/sentry-python#1090 --- sentry_sdk/_types.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sentry_sdk/_types.py b/sentry_sdk/_types.py index 95e4ac3ba3..a69896a248 100644 --- a/sentry_sdk/_types.py +++ b/sentry_sdk/_types.py @@ -5,7 +5,6 @@ if MYPY: - from numbers import Real from types import TracebackType from typing import Any from typing import Callable @@ -32,7 +31,7 @@ ErrorProcessor = Callable[[Event, ExcInfo], Optional[Event]] BreadcrumbProcessor = Callable[[Breadcrumb, BreadcrumbHint], Optional[Breadcrumb]] - TracesSampler = Callable[[SamplingContext], Union[Real, bool]] + TracesSampler = Callable[[SamplingContext], Union[float, int, bool]] # https://github.com/python/mypy/issues/5710 NotImplementedType = Any