Skip to content
Merged
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
4 changes: 3 additions & 1 deletion src/sentry/api/endpoints/event_attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ class EventAttachmentsEndpoint(ProjectEndpoint):
},
examples=EventAttachmentExamples.LIST_EVENT_ATTACHMENTS,
)
def get(self, request: Request, project, event_id) -> Response:
def get(
self, request: Request, project, event_id
) -> Response[list[EventAttachmentSerializerResponse]]:
"""
Retrieve a list of attachments uploaded for a given event.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def get_comparison_delta(self, request: Request) -> timedelta | None:
},
examples=DiscoverAndPerformanceExamples.QUERY_TIMESERIES,
)
def get(self, request: Request, organization: Organization) -> Response:
def get(self, request: Request, organization: Organization) -> Response[StatsResponse]:
"""
Retrieves explore data for a given organization as a timeseries.

Expand Down
8 changes: 5 additions & 3 deletions src/sentry/api/endpoints/source_map_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ class SourceMapDebugEndpoint(ProjectEndpoint):
},
examples=SourceMapDebugExamples.GET_SOURCE_MAP_DEBUG,
)
def get(self, request: Request, project: Project, event_id: str) -> Response:
def get(
self, request: Request, project: Project, event_id: str
) -> Response[SourceMapDebugResponse]:
"""
Return a list of source map errors for a given event.
"""
Expand Down Expand Up @@ -240,11 +242,11 @@ def get(self, request: Request, project: Project, event_id: str) -> Response:
scraping_attempt_map = get_scraping_attempt_map(event_data)

# build information about individual exceptions and their stack traces
processed_exceptions = []
processed_exceptions: list[SourceMapDebugException] = []
exception_values = get_path(event_data, "exception", "values")
if exception_values is not None:
for exception_value in exception_values:
processed_frames = []
processed_frames: list[SourceMapDebugFrame] = []
frames = get_path(exception_value, "raw_stacktrace", "frames")
stacktrace_frames = get_path(exception_value, "stacktrace", "frames")
if frames is not None:
Expand Down
4 changes: 2 additions & 2 deletions src/sentry/api/endpoints/timeseries.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Literal, NotRequired, TypedDict
from typing import Literal, NotRequired, TypedDict

# Assumed ingestion delay for timeseries, this is a static number for now just to match how the frontend was doing it
INGESTION_DELAY = 90
Expand Down Expand Up @@ -48,6 +48,6 @@ class StatsResponse(TypedDict):
timeSeries: list[TimeSeries]


EMPTY_STATS_RESPONSE: dict[str, Any] = {
EMPTY_STATS_RESPONSE: StatsResponse = {
"timeSeries": [],
}
9 changes: 7 additions & 2 deletions src/sentry/discover/endpoints/discover_saved_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ def has_feature(self, organization, request):
},
examples=DiscoverExamples.DISCOVER_SAVED_QUERIES_QUERY_RESPONSE,
)
def get(self, request: Request, organization: Organization) -> Response:
def get(
self, request: Request, organization: Organization
) -> Response[list[DiscoverSavedQueryResponse]]:
"""
Retrieve a list of saved queries that are associated with the given organization.
"""
Expand Down Expand Up @@ -141,7 +143,10 @@ def get(self, request: Request, organization: Organization) -> Response:
# Old discover expects all queries and uses this parameter.
if request.query_params.get("all") == "1":
saved_queries = list(queryset.all())
return Response(serialize(saved_queries), status=200)
return Response(
serialize(saved_queries, serializer=DiscoverSavedQueryModelSerializer()),
status=200,
)

def data_fn(offset, limit):
return list(queryset[offset : offset + limit])
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/issues/endpoints/group_hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class GroupHashesEndpoint(GroupEndpoint):
examples=EventExamples.GROUP_HASHES,
)
@deprecated(CELL_API_DEPRECATION_DATE, url_names=["sentry-api-0-group-hashes"])
def get(self, request: Request, group: Group) -> Response:
def get(self, request: Request, group: Group) -> Response[list[GroupHashesResult]]:
"""
List the hashes that make up an issue. Each hash represents a grouping
signature used to aggregate individual events into this issue.
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/releases/endpoints/project_releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ProjectReleasesEndpoint(ProjectEndpoint):
},
examples=ReleaseExamples.LIST_PROJECT_RELEASES,
)
def get(self, request: Request, project) -> Response:
def get(self, request: Request, project) -> Response[list[ReleaseSerializerResponse]]:
"""
Retrieve a list of releases for a given project.
"""
Expand Down
Loading