-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1088 allows get_code_dependency
to detect usage of objects in functions on LHS
#289
Conversation
Merge branch 'main' of https://github.com/insightsengineering/teal.data # Conflicts: # tests/testthat/test-get_code.R
Code Coverage Summary
Diff against main
Results for commit: fd4d841 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Test Performance DifferenceAdditional test case details
Results for commit 5cea288 ♻️ This comment has been updated with latest results. |
Unit Tests Summary 1 files 14 suites 1s ⏱️ Results for commit fd4d841. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code could use some comments, I can barely follow.
This is quite a long anon function:
lapply(
calls_pd,
function(call_pd) {
# Handle data(object)
[...]
lapply(
calls_pd,
function(call_pd) {
# Handle data(object)
[...] Totally this part grown, piece by piece, with every new PR! At the beginning (when we did not cover |
Hey @chlebowa hey @donyunardi because of the timing (end of day in Poland) and the need for a release this fix on CRAN I will ask @donyunardi just to make soft test (results of this function, and testing apps where teal.data is installed from this branch). Once soft tests are fine, please merge @donyunardi and submit a release on CRAN. For the implementation details I created a new card #292 where we will clean-up implementaion. |
Could the issue lies in teal.data/R/utils-get_code_dependency.R Lines 378 to 379 in 035a65c
I think this line is checking the left hand side of |
Thanks for checking @donyunardi . Will have one more look : ) |
Hey @donyunardi can you review once more? I tested on the limited code, but simplified to the below symbols :) > code <- '
+ x <- 5
+ y <- length(x)
+ names(x)[y] <- y
+ '
> tdata <- teal_data(code = code)
> cat(get_code(tdata, datanames = 'x'))
warning('Code was not verified for reproducibility.')
x <- 5
y <- length(x)
names(x)[y] <- y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! Thanks for getting this so quick!
@m7pr I'm going to merge this so I can redeploy the example apps dev branch in teal.gallery. |
@donyunardi this is the exact motivation why we need a testing environment to test things on feature branches and not on main branch. github.com/insightsengineering/coredev-tasks/issues/505 |
I agree. Let's continue the discussion on this topic. |
Closes insightsengineering/teal#1088
The issue that we tried to fix was the inability to extract lines such as
fun(object) <-
(object used in a function on lhs) in getting code for the object.Below resulted in
which now gives