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
Adding Exclude property to DoubleRangeFilter and test coverage. #1268
Adding Exclude property to DoubleRangeFilter and test coverage. #1268
Conversation
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@googlebot I fixed it |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
PR mostly looks good, I would still prefer bools over having the enum, is there more reasoning behind choosing the enum? See comments in: #1260 |
CLA issue is because of the email |
Git amend the PR with your Unity email to fix, I think. (and if possible, set that as your default github email would avoid this problem, I think?) |
6d35482
to
8b5eda1
Compare
Thanks for the tip, I did the merge from the website so it didn't use my work email. |
We went with enums because we use them often and it gave us a single fields to indicate which bounds should be excluded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't see full test coverage - given that you've moved and (mostly) copied 1 line of logic behind a switch statement with 4 clauses, full coverage implies there to be roughly 4 times the number of tests. I've thought about it more, and suggest grouping by the case, eg:
`
simpleDoubleRange("minIsNan", 5, math.NaN(), 10, pb.DoubleRangeFilter_NONE),
simpleDoubleRange("minIsNan", 5, math.NaN(), 10, pb.DoubleRangeFilter_MIN),
simpleDoubleRange("minIsNan", 5, math.NaN(), 10, pb.DoubleRangeFilter_MAX),
simpleDoubleRange("minIsNan", 5, math.NaN(), 10, pb.DoubleRangeFilter_BOTH),
simpleDoubleRange("maxIsNan", 5, 0, math.NaN(), pb.DoubleRangeFilter_NONE),
simpleDoubleRange("maxIsNan", 5, 0, math.NaN(), pb.DoubleRangeFilter_MIN),
simpleDoubleRange("maxIsNan", 5, 0, math.NaN(), pb.DoubleRangeFilter_MAX),
simpleDoubleRange("maxIsNan", 5, 0, math.NaN(), pb.DoubleRangeFilter_BOTH),
`
(empty line between the groupings)
The cases which are affected by the enum would become obvious, as there won't be full groupings. The names don't strictly need to be different, though it'd probably be helpful for the cases which are different.
What this PR does / Why we need it:
This set of changes gives more control over the excluded/included bounds of DoubleRangeFilters.
Which issue(s) this PR fixes:
Closes #1260
Special notes for your reviewer: