Fixing bug in 'on' with complex variable names#3094
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3094 +/- ##
==========================================
+ Coverage 90.92% 90.97% +0.04%
==========================================
Files 61 61
Lines 11817 11844 +27
==========================================
+ Hits 10745 10775 +30
+ Misses 1072 1069 -3
Continue to review full report at Codecov.
|
|
wow, this is great example of high quality PR. |
|
I tend to strongly agree with you @jangorecki :). Therefore, I have factored it out in the latest commit. |
mattdowle
left a comment
There was a problem hiding this comment.
LGTM. Just needs coverage of the two stop()s and one branch to achieve 100% diff coverage please.
… strictly internal.
|
Thanks @mattdowle for the review. I have adapted the tests so that all stops and branches are hit. Still, diff coverage is only 98.3 %. Looking into it suggests, that a curly bracket after an |
|
I filed the covr issue here : r-lib/covr#339 |
|
we need to replace |
|
trimws is a very simple helper function... we should add it to utils |
|
To link it for completeness, |
Closes #3092
Closes #2931
Changes
The logic, how the 'on' string gets parsed and variable names + operators are extracted has been rewritten in order to:
colA>=1Many thanks to @telenz for figuring out the algorithm.
Tests
I am assuming that the documented standard behaviour of 'on' is thoroughly tested already. Therefore, new tests only comprise situations with complex variable names including operators like
colA>=1and 'on' clauses with white spaces around the operator.Performance
No significant additional overhead. Tests in
tests.Rrawrun as fast as before. The following example with a rather complex 'on' clause shows no speed impact of back-tick 'ed variable names: