Skip to content

Commit f10b5c1

Browse files
fixup! typing fix
1 parent 545646d commit f10b5c1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/sentry/api/endpoints/debug_files.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import jsonschema
99
import orjson
1010
from django.db import IntegrityError, router
11-
from django.db.models import Case, Exists, IntegerField, Q, QuerySet, Value, When
11+
from django.db.models import Case, Exists, F, IntegerField, Q, QuerySet, Value, When
1212
from django.http import Http404, HttpResponse, StreamingHttpResponse
1313
from rest_framework import status
1414
from rest_framework.request import Request
@@ -515,7 +515,7 @@ def batch_assemble(project: Project, files: AssembleRequestPayload):
515515
)
516516

517517
for debug_file in existing_debug_files:
518-
checksum = debug_file.checksum
518+
checksum = debug_file.nonnull_checksum
519519
file = files_to_check.pop(checksum)
520520
requested_debug_id = requested_debug_ids_by_checksum[checksum]
521521

@@ -633,6 +633,7 @@ def _is_proguard_reupload_clone_request(
633633

634634

635635
class _DebugFileAnnotations(TypedDict):
636+
nonnull_checksum: str
636637
requested_debug_id_match: int
637638
proguard_clone_source_match: int
638639

@@ -677,8 +678,11 @@ def _find_existing_debug_files(
677678
ProjectDebugFile.objects.filter(
678679
project_id=project.id,
679680
checksum__in=checksums,
681+
checksum__isnull=False,
680682
)
681683
.annotate(
684+
# Mirror the filtered checksum into an annotated non-null field for type safety.
685+
nonnull_checksum=F("checksum"),
682686
requested_debug_id_match=_build_requested_debug_id_match_annotation(
683687
requested_debug_ids_by_checksum.items()
684688
),

0 commit comments

Comments
 (0)