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

Fix distinct call for range filters #855

Merged
merged 2 commits into from
Jul 13, 2018

Conversation

rpkilby
Copy link
Collaborator

@rpkilby rpkilby commented Jan 16, 2018

Per @joinworldtv with #417 (comment)

Instead of reimplementing the .filter() method entirely, the override simply alters the .lookup_expr and value, then calls the base method.

@codecov-io
Copy link

codecov-io commented Jan 16, 2018

Codecov Report

Merging #855 into master will increase coverage by 0.17%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #855      +/-   ##
==========================================
+ Coverage   97.95%   98.12%   +0.17%     
==========================================
  Files          15       15              
  Lines        1122     1121       -1     
==========================================
+ Hits         1099     1100       +1     
+ Misses         23       21       -2
Impacted Files Coverage Δ
django_filters/filters.py 99.05% <100%> (+0.62%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b554a5...ac9690f. Read the comment docs.

Copy link
Owner

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

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

So surely there's a missing test case here? 🙂

@rpkilby
Copy link
Collaborator Author

rpkilby commented Jan 18, 2018

So surely there's a missing test case here? 🙂

I was thinking about that. The updated .filter() method is simply altering the lookup expression and value, before calling the base implementation. The current tests sufficiently cover that behavior, so it didn't seem necessary to add specific tests for compatibility with the other features (like exclude/distinct).

That said a sanity check wouldn't hurt.

@rpkilby
Copy link
Collaborator Author

rpkilby commented May 21, 2018

Okay, updated with some sanity tests for calling distinct.

@rpkilby rpkilby force-pushed the fix-range-distinct branch from 63539a9 to ac9690f Compare May 21, 2018 07:41
@carltongibson carltongibson merged commit afaf28a into carltongibson:master Jul 13, 2018
@rpkilby rpkilby deleted the fix-range-distinct branch July 13, 2018 13:12
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.

3 participants