Avoid N+1 queries fetching Upload.errors#1263
Conversation
8efa5ff to
662e742
Compare
✅ Sentry found no issues in your recent changes ✅ |
joseph-sentry
left a comment
There was a problem hiding this comment.
one comment about using queryset_to_connection, otherwise lgtm
Previously, this was going through an unnecessarily complex Java-esque design pattern, just to execute a query that can be much better served by using a `prefetch_related` Django combinator.
662e742 to
c224f1a
Compare
timeseries/tests/test_helpers.py
Outdated
| repository_id__in=[self.repo1.pk, self.repo2.pk], | ||
| ) | ||
| ) | ||
| ).reverse() |
There was a problem hiding this comment.
I have no idea whats going on here. For some reason I don’t understand, the assertion order for this completely unrelated code is switched around.
And its also not a flake either, as I have retried this 3 times, and its failing with the same error.
a91935a to
9f9cefb
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #1263 +/- ##
==========================================
- Coverage 96.32% 96.31% -0.01%
==========================================
Files 493 490 -3
Lines 16933 16916 -17
==========================================
- Hits 16310 16293 -17
Misses 623 623
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. 📢 Thoughts on this report? Let us know! |
Previously, this was going through an unnecessarily complex Java-esque design pattern, just to execute a query that can be much better served by using a
prefetch_relatedDjango combinator.This should fix codecov/engineering-team#3399