-
-
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
Use teal.data::get_code
instead of teal.data:::get_code_dependency
#1090
Conversation
@chlebowa can you block review, untill insightsengineering/teal.data#291 is discussed and actions are taken upon it |
Review only after this is merged insightsengineering/teal.data#290 |
Unit Tests Summary 1 files 19 suites 11s ⏱️ Results for commit b23e1db. ♻️ 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.
Blocking as requested by @m7pr
Getting this in before {teal} is on CRAN would be nice to have 1 less getFromNamespace()
in the package
insightsengineering/teal.data#290 is merged and I guess we can merge this one. Restarting GHA builds |
3 tests are failing |
I don't think this short change is enough.
Currently what gets inside |
I think the quickest fix would be to create a
|
Bad idea. Let's discuss on a call. |
Or we can change the order of in code <- c(
get_rcode_str_install(),
get_rcode_libraries(),
get_datasets_code(datanames, datasets, hashes)
)
data <- do.call(
teal.data::teal_data,
args = c(data, code = list(code), join_keys = list(datasets$get_join_keys()[datanames]))
) So that |
Code Coverage Summary
Diff against main
Results for commit: b23e1db Minimum allowed coverage is ♻️ 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.
Should work 👍
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.
Needs work after all.
May involve rewriting the module_datasets
function or a completely different approach.
Coolio. Just pasting the code we use to test the solution app <- init(
data = teal_data(
IRIS = iris,
MTCARS = mtcars,
code = "IRIS <- iris; x <-5; MTCARS <- mtcars"
),
modules = modules(
example_module(label = "all datasets", datanames = "all"),
example_module(label = "MTCARS only", datanames = "MTCARS"),
example_module(label = "IRIS only", datanames = "IRIS")
),
filter = teal_slices(
teal_slice("MTCARS", "mpg"),
teal_slice("IRIS", "Species"),
module_specific = TRUE,
mapping = list(
global_filters = c("MTCARS mpg", "IRIS Species")
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
} |
It took me a while but:
|
I think Tests for |
Or do you want me to do it? 😉 |
@chlebowa sorry for the late reply. I can handle! No worries :) |
Hey @chlebowa I cleaned up your implementation and moved the function to utils.R. Added small roxygen documentation. Used your testing scenario in a test in testtthat folder. Lastly change the name of |
Excellent 👌 |
Unit Test Performance DifferenceAdditional test case details
Results for commit 46845ce ♻️ This comment has been updated with latest results. |
Co-authored-by: Aleksander Chlebowski <[email protected]> Signed-off-by: Marcin <[email protected]>
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.
Some minor comments, otherwise ready.
Co-authored-by: Aleksander Chlebowski <[email protected]> Signed-off-by: Marcin <[email protected]>
Co-authored-by: Aleksander Chlebowski <[email protected]> Signed-off-by: Marcin <[email protected]>
…g/teal into get_code@main
After introduction of
...
inteal.data::get_code()
during insightsengineering/teal.data#290,I reckon there is no point using non-exported
teal.data:::get_code_dependency
and we can just use exported
teal.data::get_code
.Merge only when this is discussed and updated version of
teal.data
lands on CRAN insightsengineering/teal.data#291