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

Subset by bug #2748

Merged
merged 6 commits into from Apr 13, 2018
Merged

Subset by bug #2748

merged 6 commits into from Apr 13, 2018

Conversation

MarkusBonsch
Copy link
Contributor

Closes #2713 and #2591:

I fixed a bug in src/dogroups.c that caused wrong entries in the grouping column if:

  • by was used during a join
  • on= was used to specify the join columns
  • The grouping column was sorted and contained groups longer than 1 row.

The following example from issue #2713 works correctly now:

library(data.table)
DT = data.table(
    id = c("a","a","a","b","b","c","c","d","d"),
    group = c(1,1,1,1,1,2,2,2,2),
    num = 1)
#    group V1
# 1:  1     2
# 2:  2     2

I updated tests and added a comment that explains the reasoning for my change into the source code.

@codecov-io
Copy link

codecov-io commented Apr 13, 2018

Codecov Report

Merging #2748 into master will increase coverage by 0.09%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2748      +/-   ##
==========================================
+ Coverage   93.43%   93.53%   +0.09%     
==========================================
  Files          61       61              
  Lines       12296    12495     +199     
==========================================
+ Hits        11489    11687     +198     
- Misses        807      808       +1
Impacted Files Coverage Δ
src/dogroups.c 93.35% <100%> (-0.05%) ⬇️
src/fread.c 98.19% <0%> (+0.21%) ⬆️

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 c579e01...95b3692. Read the comment docs.

@mattdowle mattdowle added this to the v1.10.6 milestone Apr 13, 2018
Copy link
Member

@mattdowle mattdowle left a comment

Choose a reason for hiding this comment

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

Fantastic! Thanks for quick fix.

@mattdowle mattdowle merged commit c2f6ea0 into master Apr 13, 2018
@mattdowle mattdowle deleted the subset-by-bug branch April 13, 2018 22:56
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.

Keyby/by not returning unique groups with subsetting
3 participants