Fixed nested ':=' reference assignment fails (#6768)#6788
Closed
AntonNM wants to merge 5 commits intoRdatatable:masterfrom
Closed
Fixed nested ':=' reference assignment fails (#6768)#6788AntonNM wants to merge 5 commits intoRdatatable:masterfrom
AntonNM wants to merge 5 commits intoRdatatable:masterfrom
Conversation
*Followed TODO: by mattdowle from resolution to '2-space indentation Rdatatable#2420' *Added tests for jsub that modify DT by-reference *Added test case for interger vector indexing
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6788 +/- ##
==========================================
- Coverage 98.60% 98.57% -0.04%
==========================================
Files 79 79
Lines 14642 14657 +15
==========================================
+ Hits 14438 14448 +10
- Misses 204 209 +5 ☔ View full report in Codecov by Sentry. |
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.
Fixed nested ':=' reference assignment fails (#6768)
By reference assignments (':=') with functions that modified the data.table by reference e.g. (
foo=function(DT){modify(DT);return(1L)},DT[,a:=foo(DT)]) returned a mallformed data.table due to the modification of the targeted named column index ("a") during the j expression evaluation*Completed TODO: by mattdowle from commits to '2-space indentation #2420' to move allocation logic after jsub evaluation
chmatch and setalloccol calls moved below jsub evaluation which fixed name to column index mapping. Warnings and conditions to terminate early remain before the evaluation. selfrefok warning and following branch were split to accommodate this and to avoid duplicate warnings
*Added tests for jsub expressions that modify DT by-reference
Includes the test that initially demonstrated the bug and an additional test case for future regression testing.
*Added test case for integer vector indexing
Removed pre-jsub-eval numerical lhs to name mapping to prevent issues with duplicate name issues.
Closes #6768