Repository navigation
DT() mimics calling [.data.table in that frame - #5176
Merged
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5176 +/- ##
=======================================
Coverage 99.38% 99.38%
=======================================
Files 77 77
Lines 14507 14510 +3
=======================================
+ Hits 14418 14421 +3
Misses 89 89
Continue to review full report at Codecov.
|
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.
Solves issue 2 within #5129
Added the tests in #5129 (comment) thanks to @Kamgang-B.
The
ienvforeval(.massagei(isub), x, ienv)is created withnew.env(parent=parent.frame())so thatparent.frame()would need to be something likeparent.frame(parent.frame())when[.data.tablehad been called from the wrapperDT(). Since there are several otherparent.frame()calls inside[.data.table, I went for the approach of makingDT()evaluate[.data.tablein itsparent.frame(); i.e. mimic as if[.data.tablehad been called directly instead of using the wrapperDT().Doing that broke test 2212.26-28 but that's good because those were only not changing
Ddue to this scoping. That reassured me that this approach ofDT()evaluating[.data.tablein calling scope was somehow correct. When a future PR makesDT(:=)return a shallow copy (issue 1 within #5129 and subsequent comments) then those re-copies ofmtcarsin the tests can be removed and I put a TODO on those copies.Also, I realized the
y=of those tests shouldn't be reusing the inputD(which was hiding the fact they shouldn't have been passing in some cases) so that's fixed here by usingmtcarsiny=.All in dev before release hence tagged dev.