Skip to content

ref: fix typing for models.debugfile #72800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2024
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
5 changes: 2 additions & 3 deletions src/sentry/models/debugfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ def find_missing(self, checksums: Iterable[str], project: Project) -> list[str]:

found = ProjectDebugFile.objects.filter(
checksum__in=checksums, project_id=project.id
).values("checksum")
).values_list("checksum", flat=True)

for values in found:
missing.discard(list(values.values())[0])
missing.difference_update(checksum for checksum in found if checksum is not None)

return sorted(missing)

Expand Down
5 changes: 5 additions & 0 deletions tests/sentry/models/test_debugfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ def test_find_dif_miss_by_features(self):
)
assert debug_id not in difs

def test_find_missing(self):
dif = self.create_dif_file(debug_id="dfb8e43a-f242-3d73-a453-aeb6a777ef75-feedface")
ret = ProjectDebugFile.objects.find_missing([dif.checksum, "a" * 40], self.project)
assert ret == ["a" * 40]


class CreateDebugFileTest(APITestCase):
@property
Expand Down