Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/arq.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def _capture_exception(exc_info):
def _make_event_processor(ctx, *args, **kwargs):
# type: (Dict[Any, Any], *Any, **Any) -> EventProcessor
def event_processor(event, hint):
# type: (Event, Hint) -> Optional[Event]
# type: (Event, Hint) -> Event

with capture_internal_exceptions():
scope = sentry_sdk.get_current_scope()
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ async def _sentry_wrapped_send(event):
_asgi_middleware_applied.set(False)

def event_processor(self, event, hint, asgi_scope):
# type: (Event, Hint, Any) -> Optional[Event]
# type: (Event, Hint, Any) -> Event
Comment on lines 272 to +273
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this method considered public because there's no leading underscore?

request_data = event.get("request", {})
request_data.update(_get_request_data(asgi_scope))
event["request"] = deepcopy(request_data)
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/aws_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def _make_request_event_processor(aws_event, aws_context, configured_timeout):
start_time = datetime.now(timezone.utc)

def event_processor(sentry_event, hint, start_time=start_time):
# type: (Event, Hint, datetime) -> Optional[Event]
# type: (Event, Hint, datetime) -> Event
remaining_time_in_milis = aws_context.get_remaining_time_in_millis()
exec_duration = configured_timeout - remaining_time_in_milis

Expand Down
8 changes: 4 additions & 4 deletions sentry_sdk/integrations/dramatiq.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from typing import Any, Callable, Dict, Optional, Union
from sentry_sdk._types import Event, Hint
from typing import Any, Dict, Optional, Union
from sentry_sdk._types import Event, Hint, EventProcessor


class DramatiqIntegration(Integration):
Expand Down Expand Up @@ -128,10 +128,10 @@ def after_process_message(self, broker, message, *, result=None, exception=None)


def _make_message_event_processor(message, integration):
# type: (Message, DramatiqIntegration) -> Callable[[Event, Hint], Optional[Event]]
# type: (Message, DramatiqIntegration) -> EventProcessor

def inner(event, hint):
# type: (Event, Hint) -> Optional[Event]
# type: (Event, Hint) -> Event
with capture_internal_exceptions():
DramatiqMessageExtractor(message).extract_into_event(event)

Expand Down
6 changes: 3 additions & 3 deletions sentry_sdk/integrations/fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from typing import Any, Callable, Dict
from sentry_sdk._types import Event
from typing import Any, Dict
from sentry_sdk._types import Event, EventProcessor

try:
from sentry_sdk.integrations.starlette import (
Expand Down Expand Up @@ -112,7 +112,7 @@ async def _sentry_app(*args, **kwargs):
info = await extractor.extract_request_info()

def _make_request_event_processor(req, integration):
# type: (Any, Any) -> Callable[[Event, Dict[str, Any]], Event]
# type: (Any, Any) -> EventProcessor
def event_processor(event, hint):
# type: (Event, Dict[str, Any]) -> Event

Expand Down
3 changes: 1 addition & 2 deletions sentry_sdk/integrations/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from typing import Any
from typing import TypeVar
from typing import Callable
from typing import Optional

from sentry_sdk._types import EventProcessor, Event, Hint

Expand Down Expand Up @@ -154,7 +153,7 @@ def _make_request_event_processor(gcp_event, configured_timeout, initial_time):
# type: (Any, Any, Any) -> EventProcessor

def event_processor(event, hint):
# type: (Event, Hint) -> Optional[Event]
# type: (Event, Hint) -> Event

final_time = datetime.now(timezone.utc)
time_diff = final_time - initial_time
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/huey.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _sentry_enqueue(self, task):
def _make_event_processor(task):
# type: (Any) -> EventProcessor
def event_processor(event, hint):
# type: (Event, Hint) -> Optional[Event]
# type: (Event, Hint) -> Event

with capture_internal_exceptions():
tags = event.setdefault("tags", {})
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/spark/spark_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _add_event_processor(sc):

@scope.add_event_processor
def process_event(event, hint):
# type: (Event, Hint) -> Optional[Event]
# type: (Event, Hint) -> Event
with capture_internal_exceptions():
if sentry_sdk.get_client().get_integration(SparkIntegration) is None:
return event
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/spark/spark_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _tag_task_context():

@scope.add_event_processor
def process_event(event, hint):
# type: (Event, Hint) -> Optional[Event]
# type: (Event, Hint) -> Event
with capture_internal_exceptions():
integration = sentry_sdk.get_client().get_integration(
SparkWorkerIntegration
Expand Down
4 changes: 2 additions & 2 deletions sentry_sdk/integrations/starlette.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
if TYPE_CHECKING:
from typing import Any, Awaitable, Callable, Container, Dict, Optional, Tuple, Union

from sentry_sdk._types import Event, HttpStatusCodeRange
from sentry_sdk._types import Event, HttpStatusCodeRange, EventProcessor

try:
import starlette # type: ignore
Expand Down Expand Up @@ -454,7 +454,7 @@ async def _sentry_async_func(*args, **kwargs):
info = await extractor.extract_request_info()

def _make_request_event_processor(req, integration):
# type: (Any, Any) -> Callable[[Event, dict[str, Any]], Event]
# type: (Any, Any) -> EventProcessor
def event_processor(event, hint):
# type: (Event, Dict[str, Any]) -> Event

Expand Down