Skip to content

Commit b1e6576

Browse files
committed
some type fixes
1 parent 2051f23 commit b1e6576

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

sentry_sdk/integrations/strawberry.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@
2828

2929
try:
3030
from strawberry import Schema
31-
from strawberry.extensions import SchemaExtension # type: ignore
32-
from strawberry.extensions.tracing.utils import should_skip_tracing as strawberry_should_skip_tracing # type: ignore
33-
from strawberry.http import async_base_view, sync_base_view # type: ignore
31+
from strawberry.extensions import SchemaExtension
32+
from strawberry.extensions.tracing.utils import (
33+
should_skip_tracing as strawberry_should_skip_tracing,
34+
)
35+
from strawberry.http import async_base_view, sync_base_view
3436
except ImportError:
3537
raise DidNotEnable("strawberry-graphql is not installed")
3638

3739
try:
38-
from strawberry.extensions.tracing import ( # type: ignore
40+
from strawberry.extensions.tracing import (
3941
SentryTracingExtension as StrawberrySentryAsyncExtension,
4042
SentryTracingExtensionSync as StrawberrySentrySyncExtension,
4143
)
@@ -47,9 +49,9 @@
4749

4850
if TYPE_CHECKING:
4951
from typing import Any, Callable, Generator, List, Optional
50-
from graphql import GraphQLError, GraphQLResolveInfo # type: ignore
52+
from graphql import GraphQLError, GraphQLResolveInfo
5153
from strawberry.http import GraphQLHTTPResponse
52-
from strawberry.types import ExecutionContext # type: ignore
54+
from strawberry.types import ExecutionContext
5355
from sentry_sdk._types import Event, EventProcessor
5456

5557

@@ -122,10 +124,10 @@ def _sentry_patched_schema_init(self, *args, **kwargs):
122124

123125
return old_schema_init(self, *args, **kwargs)
124126

125-
Schema.__init__ = _sentry_patched_schema_init
127+
Schema.__init__ = _sentry_patched_schema_init # type: ignore[method-assign]
126128

127129

128-
class SentryAsyncExtension(SchemaExtension): # type: ignore
130+
class SentryAsyncExtension(SchemaExtension):
129131
def __init__(
130132
self,
131133
*,
@@ -326,10 +328,10 @@ def _sentry_patched_handle_errors(self, errors, response_data):
326328
)
327329
sentry_sdk.capture_event(event, hint=hint)
328330

329-
async_base_view.AsyncBaseHTTPView._handle_errors = (
331+
async_base_view.AsyncBaseHTTPView._handle_errors = ( # type: ignore[method-assign]
330332
_sentry_patched_async_view_handle_errors
331333
)
332-
sync_base_view.SyncBaseHTTPView._handle_errors = (
334+
sync_base_view.SyncBaseHTTPView._handle_errors = ( # type: ignore[method-assign]
333335
_sentry_patched_sync_view_handle_errors
334336
)
335337

0 commit comments

Comments
 (0)