-
-
Notifications
You must be signed in to change notification settings - Fork 15
{teal}
module returns a teal_report
object that extends from teal_data
#884
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
base: main
Are you sure you want to change the base?
Conversation
{teal}
module returns a teal_report
object that extends from teal_data
insightsengineering/teal#1541
Code Coverage Summary
Diff against main
Results for commit: 7c2dc13 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Tests Summary 1 files 22 suites 2s ⏱️ Results for commit 7c2dc13. ♻️ This comment has been updated with latest results. |
Companion to insightsengineering/teal.reporter#334 Consequence of changing naming convention for `teal_report` object. --------- Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
…l_data` (#255) # Pull Request Fixes: - insightsengineering/teal#1526 Built on top of: - insightsengineering/teal.reporter#307 - _(#307 will be closed once this PR is stable)_ ### Companion PRs: - insightsengineering/teal#1541 - #255 - insightsengineering/teal.data#370 - insightsengineering/teal.reporter#331 - insightsengineering/teal.modules.general#884 ### Changes description - [x] Add new parameter `cache` - Caches the result of the last evaluation in the respective `@code` slot - [ ] Decide on name - [x] Remove signature with multiple arguments to allow overriding `eval_code` in other packages without showing a note ``` r pkgload::load_all("teal.code") #> ℹ Loading teal.code q <- qenv() |> eval_code(1 + 1, cache = TRUE) |> eval_code(mtcars <- head(mtcars)) attr(q@code[[1]], "cache") #> [1] 2 ``` <sup>Created on 2025-06-03 with [reprex v2.1.1](https://reprex.tidyverse.org)</sup> --------- Co-authored-by: Dawid Kaledkowski <dawid.kaledkowski@gmail.com> Co-authored-by: Marcin <133694481+m7pr@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
…l_data` (#370) # Pull Request Fixes: - insightsengineering/teal#1526 Built on top of: - insightsengineering/teal.reporter#307 - _(#307 will be closed once this PR is stable)_ ### Companion PRs: - insightsengineering/teal#1541 - insightsengineering/teal.code#255 - #370 - insightsengineering/teal.reporter#331 - insightsengineering/teal.modules.general#884 ### Changes description - [x] Cleanup of `teal_data` class to allow for `teal_report` extension - [x] Change the `show()` method to remove reference to `teal_data` specifically --------- Co-authored-by: Dawid Kaledkowski <dawid.kaledkowski@gmail.com> Co-authored-by: Marcin <133694481+m7pr@users.noreply.github.com>
# Pull Request - Changes from `teal_reportable` branch at `{ŧeal.report}` - Remove old logic that was defusing the argument
Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com>
Merging this to a feature branch. The rest can be dona as normal issues. Thanks!
Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com>
…g modules results
Signed-off-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
Signed-off-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com>
There are R CMD CHECK warnings |
@@ -982,7 +989,7 @@ srv_a_regression <- function(id, | |||
|
|||
output_q <- reactive({ | |||
teal::validate_inputs(iv_r()) | |||
switch(input$plot_type, | |||
obj <- switch(input$plot_type, |
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.
Result will be the switch, why use obj
?
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.
Yeah, instead of
obj <- switch(input$plot_type,
"Response vs Regressor" = output_plot_0(),
"Residuals vs Fitted" = output_plot_1(),
"Normal Q-Q" = output_plot_2(),
"Scale-Location" = output_plot_3(),
"Cook's distance" = output_plot_4(),
"Residuals vs Leverage" = output_plot_5(),
"Cook's dist vs Leverage" = output_plot_6()
)
obj
we can go with
switch(input$plot_type,
"Response vs Regressor" = output_plot_0(),
"Residuals vs Fitted" = output_plot_1(),
"Normal Q-Q" = output_plot_2(),
"Scale-Location" = output_plot_3(),
"Cook's distance" = output_plot_4(),
"Residuals vs Leverage" = output_plot_5(),
"Cook's dist vs Leverage" = output_plot_6()
)
) | ||
|
||
fitted <- reactive({ | ||
req(output_q()) | ||
req(decorated_output_q()) |
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.
❤️ good catch on both of these
teal.reporter::teal_card(obj), | ||
teal.reporter::teal_card("## Module's code") | ||
) | ||
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr");library("tidyr")') # nolint: quotes. |
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.
What do you think about this change?
If you like it, I can find and replace all of these.
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr");library("tidyr")') # nolint: quotes. | |
teal.code::eval_code(obj, expression(library("ggplot2"), library("dplyr"), library("tidyr")) |
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.
This is done in other modules
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.
thanks
@@ -370,7 +371,7 @@ srv_g_scatterplotmatrix <- function(id, | |||
|
|||
# check character columns. If any, then those are converted to factors | |||
check_char <- vapply(ANL[, cols_names], is.character, logical(1)) | |||
qenv <- teal.code::eval_code(qenv, 'library("dplyr")') # nolint quotes | |||
qenv <- teal.code::eval_code(qenv, 'library("dplyr")') # nolint: quotes. |
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.
Duplicate?
What is happening here so that the duplicate library
call is present on Show R Code
and not on reporter previewer?
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.
it was on main
. I didn't actually verify if this is needed. I think we could remove as it's already called earlier in this module
R/tm_missing_data.R
Outdated
grid::grid.newpage() | ||
grid::grid.draw(combination_plot) | ||
} | ||
combination_plot |
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.
@@ -906,6 +909,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, | |||
# Cumulative distribution plot | |||
cumulative_plot_q <- reactive({ | |||
qenv <- common_code_q() | |||
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## Cumulative Distribution Plot") |
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.
Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com> Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com>
Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com> Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com>
Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com>
Signed-off-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
Pull Request
Fixes:
Built on top of:
teal.reporter
Cards teal#1499 (will be closed once this PR is stable)Companion PRs:
{teal}
module returns ateal_report
object that extends fromteal_data
teal#1541{teal}
module returns ateal_report
object that extends fromteal_data
teal.code#255{teal}
module returns ateal_report
object that extends fromteal_data
teal.data#370{teal}
module returns ateal_report
object that extends fromteal_data
teal.reporter#331{teal}
module returns ateal_report
object that extends fromteal_data
#884Changes description
teal_report
object on every module