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

Closes #1947, exception for gmin/gmax not to fail on ordered factors #2944

Merged
merged 3 commits into from
Aug 13, 2018

Conversation

MichaelChirico
Copy link
Member

@MichaelChirico MichaelChirico commented Jun 20, 2018

#1947 I'm kind of surprised how easy this fix was.

Copy link
Member

@jangorecki jangorecki left a 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.
Copy link
Member

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 :)

old_optim = options(datatable.optimize = Inf)
test(1914.5, DT[ , min(V1), by = V2],
data.table(
V2 = c("c", "d", "e", "f"),
Copy link
Member

@jangorecki jangorecki Jun 20, 2018

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

@jangorecki jangorecki left a comment

Choose a reason for hiding this comment

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

LGTM

@mattdowle mattdowle added this to the 1.11.6 milestone Aug 13, 2018
@mattdowle mattdowle merged commit ca80769 into master Aug 13, 2018
@mattdowle mattdowle deleted the ordered_factor branch August 13, 2018 19:55
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.

4 participants