Skip to content
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

Annotate query results with QuerySet instead of BaseManager #3668

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

cmsetzer
Copy link
Contributor

In #3659, we discussed finding a better type annotation for Django ORM querysets than BaseManager.

I had the impression we'd need to add an external dependency for this, but it turns out we can in fact do QuerySet[LinkUser] and so on. Moreover, django-stubs seems to have its own nuances (and only supports Mypy?); seems not worth bringing in at present.

This branch swaps QuerySet type hints in for all our existing BaseManagers. There should be zero impact on Perma functionality, as this is purely a dev-side change.

@cmsetzer cmsetzer requested a review from a team as a code owner November 26, 2024 21:26
@cmsetzer cmsetzer requested review from rebeccacremona and removed request for a team November 26, 2024 21:26
Copy link
Contributor

@rebeccacremona rebeccacremona left a comment

Choose a reason for hiding this comment

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

Oh great!!

Copy link

codecov bot commented Nov 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.05%. Comparing base (07d00eb) to head (b3ac30e).
Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3668      +/-   ##
===========================================
+ Coverage    69.01%   69.05%   +0.03%     
===========================================
  Files           54       54              
  Lines         7478     7493      +15     
===========================================
+ Hits          5161     5174      +13     
- Misses        2317     2319       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cmsetzer cmsetzer merged commit 693bfe5 into harvard-lil:develop Nov 26, 2024
2 checks passed
@cmsetzer cmsetzer deleted the queryset-type-annotation branch November 26, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants