Sets clearer warning for keyby in ad-hoc columns#3685
Sets clearer warning for keyby in ad-hoc columns#3685mattdowle merged 6 commits intoRdatatable:masterfrom
Conversation
|
Thanks for this! I'm afraid I misled in the issue about what is going on. Here's the relevant code block: So normal behavior is: columns from by are Hence the else branch simply throws this warning and then |
|
Don't forget to add an entry to |
|
I'm wondering now whether this actually rises to the level of being a |
Codecov Report
@@ Coverage Diff @@
## master #3685 +/- ##
=======================================
Coverage 98.25% 98.25%
=======================================
Files 69 69
Lines 13088 13088
=======================================
Hits 12860 12860
Misses 228 228
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #3685 +/- ##
=========================================
Coverage ? 98.25%
=========================================
Files ? 69
Lines ? 13085
Branches ? 0
=========================================
Hits ? 12857
Misses ? 228
Partials ? 0
Continue to review full report at Codecov.
|
|
I deleted the second sentence, then! I'm the end result is not a keyed data.table, so I think it's important to at least throw a warning to alert the user that the result is not as expected. |
|
The new warning is But that's not true: > DT = data.table(a=1:2, b=1:10)
> DT
a b
<int> <int>
1: 1 1
2: 2 2
3: 1 3
4: 2 4
5: 1 5
6: 2 6
7: 1 7
8: 2 8
9: 1 9
10: 2 10
> DT[,sum(a),by=b%%2L]
b V1
<int> <int>
1: 1 5
2: 0 10
> DT[,sum(a),keyby=b%%2L]
b V1
<int> <int>
1: 0 10
2: 1 5
> key(.Last.value)
[1] "b"
> It's |
Hi!
I wanted to contribute with some easy fixes to start learning about the codebase.
This fixes #2763.
I changed the appropriate test. I tested locally and got some errors unrelated to my change (since they were related to dates, I think they might have to do with my locale?).