|
19 | 19 | import certifi |
20 | 20 |
|
21 | 21 | import sentry_sdk |
22 | | -from sentry_sdk._types import EventDataCategory |
23 | 22 | from sentry_sdk.consts import EndpointType |
24 | 23 | from sentry_sdk.utils import Dsn, logger, capture_internal_exceptions |
25 | 24 | from sentry_sdk.worker import BackgroundWorker |
26 | 25 | from sentry_sdk.envelope import Envelope, Item, PayloadRef |
27 | 26 |
|
28 | | -from typing import TYPE_CHECKING, cast |
| 27 | +from typing import TYPE_CHECKING |
29 | 28 |
|
30 | 29 | if TYPE_CHECKING: |
31 | 30 | from typing import Any |
|
44 | 43 | from urllib3.poolmanager import PoolManager |
45 | 44 | from urllib3.poolmanager import ProxyManager |
46 | 45 |
|
47 | | - from sentry_sdk._types import Event |
| 46 | + from sentry_sdk._types import Event, EventDataCategory |
48 | 47 |
|
49 | 48 | KEEP_ALIVE_SOCKET_OPTIONS = [] |
50 | 49 | for option in [ |
@@ -181,18 +180,17 @@ def _parse_rate_limits(header, now=None): |
181 | 180 |
|
182 | 181 | retry_after = now + timedelta(seconds=int(retry_after_val)) |
183 | 182 | for category in categories and categories.split(";") or (None,): |
184 | | - category = cast(EventDataCategory, category) |
185 | 183 | if category == "metric_bucket": |
186 | 184 | try: |
187 | 185 | namespaces = parameters[4].split(";") |
188 | 186 | except IndexError: |
189 | 187 | namespaces = [] |
190 | 188 |
|
191 | 189 | if not namespaces or "custom" in namespaces: |
192 | | - yield category, retry_after |
| 190 | + yield category, retry_after # type: ignore |
193 | 191 |
|
194 | 192 | else: |
195 | | - yield category, retry_after |
| 193 | + yield category, retry_after # type: ignore |
196 | 194 | except (LookupError, ValueError): |
197 | 195 | continue |
198 | 196 |
|
|
0 commit comments