-
Notifications
You must be signed in to change notification settings - Fork 993
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
Closes #1947, exception for gmin/gmax not to fail on ordered factors #2944
Conversation
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.
good spot of low hanging fruit
NEWS.md
Outdated
@@ -7,6 +7,8 @@ | |||
|
|||
#### BUG FIXES | |||
|
|||
1. `gmin` and `gmax` no longer fail on _ordered_ factors, for which these operations are indeed meaningful, [#1947](https://github.com/Rdatatable/data.table/issues/1947#issuecomment-398212372). Thanks to @mcieslik-mctp for identifying and @mbacou for the nudge. |
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.
link to issue is enough, don't need to link particular comment :)
inst/tests/tests.Rraw
Outdated
old_optim = options(datatable.optimize = Inf) | ||
test(1914.5, DT[ , min(V1), by = V2], | ||
data.table( | ||
V2 = c("c", "d", "e", "f"), |
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.
In both GForce tests you used distinct values to group by in V2 field, which is somehow an edge case when grouping. In case of min/max then it is simply "as is" for each group. Would be a little bit safer to have GForce tests with 3 rows matching same group, so min/max on those is actually tested.
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.
OK, just copy-pasted the example from the issue, will make a more careful one.
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.
@MichaelChirico nice catch/fix. If you can ping me when you've added the test you'd like to, I'd be happy to merge.
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.
LGTM
#1947 I'm kind of surprised how easy this fix was.