-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
210 substitute teal.data::get_code
with teal.code::get_code
#1388
Conversation
Code Coverage Summary
Diff against main
Results for commit: eb5aed1 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Tests Summary 1 files 25 suites 8m 29s ⏱️ Results for commit eb5aed1. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Results for commit d7e2367 ♻️ 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.
I'm sceptic about class(data) <- "qenv"
to force usage of the teal.code
method. What is the reason? Is it to avoid deprecation warning create teal.data::get_code
?
@gogonzo |
Yes and not. teal_data() |> inherits("qenv")
# TRUE
No, it doesn't. Generic selects a method which matches the teal_data() |> teal.code::get_code()
# [1] "hello" |
…e teal.code::get_code on teal_data
My bad! You are right. I got confused. Reverted the change. |
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.
👍
BLOCKED by - insightsengineering/teal.data#340 Closes - #210 Companion to - insightsengineering/teal.data#343 - insightsengineering/teal#1388 # Description Brings `names` parameter to `get_code` so that you can limit returned code to specific objects (and the lines that create those objects). `get_code_dependency` was moved from `teal.data` # Tested with ``` r library(teal.code) # EVAL CODE q <- qenv() q <- eval_code(q, code = c("a <- 1", "b <- 2")) q@code #> [1] "a <- 1\nb <- 2" get_code(q, names = "a") #> [1] "a <- 1" # WITHIN q <- qenv() q <- within(q, {a <- 1; b <- 2}) q@code #> [1] "a <- 1\nb <- 2" get_code(q, names = "a") #> [1] "a <- 1" # OLD TEAL.DATA t <- teal.data::teal_data(a = 5, code = c("a <- 1", "b <- 2")) t@code #> [1] "a <- 1\nb <- 2" teal.data::get_code(t, datanames = 'a') #> Warning in .local(object, deparse, ...): get_code(datanames) was deprecated in #> teal.data 0.6.1, use get_code(names) instead. #> [1] "a <- 1" ``` <sup>Created on 2024-10-16 with [reprex v2.1.1](https://reprex.tidyverse.org)</sup> # Local tests ```r > devtools::test() ℹ Testing teal.code ✔ | F W S OK | Context ✔ | 12 | qenv_concat ✔ | 8 | qenv_constructor ✔ | 26 | qenv_eval_code ✔ | 2 60 | qenv_get_code [1.1s] ✔ | 10 | qenv_get_var ✔ | 7 | qenv_get_warnings ✔ | 40 | qenv_join ✔ | 14 | qenv_within ✔ | 12 | utils ══ Results ══════════════════════════════════════════════════════════════════ Duration: 2.2 s ── Skipped tests (2) ──────────────────────────────────────────────────────── • This is not urgent and can be ommitted with @linksto tag. (1): test-qenv_get_code.R:526:3 • We will not resolve this, as this requires code evaluation. (1): test-qenv_get_code.R:318:3 [ FAIL 0 | WARN 0 | SKIP 2 | PASS 189 ] ```` # Local R CMD CHECK ```r ── R CMD check results ──────────────────────────────────── teal.code 0.5.0.9010 ──── Duration: 33.5s ❯ checking for future file timestamps ... NOTE unable to verify current time 0 errors ✔ | 0 warnings ✔ | 1 note ✖ R CMD check succeeded ``` --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com>
Part of - insightsengineering/teal.code#210 Companion to - insightsengineering/teal#1388 - insightsengineering/teal.code#214 # Description Deprecates the usage of `datanames` parameter in `teal.data::get_code(datanames)` in favour of `teal.code::get_code(names)`. VBUMP package version locally to something greater than `0.6.1` during testing. ``` r library(teal.data) #> Loading required package: teal.code tdata1 <- within(teal_data(), {a <- 1; b <- 2}) get_code(tdata1) #> [1] "a <- 1\nb <- 2" get_code(tdata1, datanames = "a") #> Warning: The `datanames` argument of `get_code()` is deprecated as of teal.data 0.6.1. #> ℹ Please use the `names` argument of `teal.code::get_code()` instead. #> ℹ The deprecated feature was likely used in the teal.data package. #> Please report the issue at #> <https://github.com/insightsengineering/teal.data/issues>. #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was #> generated. #> [1] "a <- 1" ``` <sup>Created on 2024-10-17 with [reprex v2.1.1](https://reprex.tidyverse.org)</sup> --------- Signed-off-by: Marcin <[email protected]> Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Pawel Rucki <[email protected]>
CI/CD pulls released versions. Probably after replacing staged.dependencies action insightsengineering/nestdevs-tasks#65 @m7pr I think you need to bump teal.code version. You'll need to do the same in merged |
Partner to
datanames
inteal.data::get_code
teal.data#343get_code_dependency
teal.code#214Replace
teal.data::get_code()
(that worked onteal_data()
) withteal.code::get_code()
(that works onqenv
).