Clarify .I behavior for non-matching rows in joins with by = .EACHI#7258
Draft
Clarify .I behavior for non-matching rows in joins with by = .EACHI#7258
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7258 +/- ##
=========================================
Coverage ? 98.79%
=========================================
Files ? 81
Lines ? 15254
Branches ? 0
=========================================
Hits ? 15070
Misses ? 184
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ben-schwen
reviewed
Aug 22, 2025
|
|
||
| The reason for this difference is crucial: | ||
| - In Case 1, we are performing a value lookup. A failed lookup results in a missing value (`NA`). | ||
| - In Case 2, we are performing an evaluation. The symbol `.I` is defined as "the row indices in `x` for the current group". For non-matching rows like `D`, the group of matching rows in d1 is empty. The set of indices for an empty group is integer(0). data.table represents this zero-length result as a single `0` in the output. |
Member
There was a problem hiding this comment.
where does this info come from?
Member
|
Not sure |
Member
|
Tbh I would also rather fix it than adopting documentation. edit: this should then also close #3452 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #5457
this pr
Clarifies
.Idocs in joins withby = .EACHI:Column lookup = NA
.I/.Non unmatched groups → 0Docs updated, no behavior change.
hi @MichaelChirico @tdhock can you please have a look when you got time
thanks.