Skip to content
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

[Bug]: The verification status of the teal_data object is lost making all data to be unverified #1069

Closed
3 tasks done
vedhav opened this issue Jan 25, 2024 · 1 comment · Fixed by #1070
Closed
3 tasks done
Assignees
Labels
bug Something isn't working core

Comments

@vedhav
Copy link
Contributor

vedhav commented Jan 25, 2024

What happened?

As pointed out over here insightsengineering/teal.modules.clinical#919 (comment)
even when a verified teal_data object is passed into the init it becomes unverified when it reaches the modules.

This happens because we always create a teal_data object without verifying in the .datasets_to_data function.

Changes to be made:

  1. Update the teal.data::teal_data so that it can handle check = TRUE case.
  2. Update the teal module server functions to properly pass the check into this function.

Example apps for testing:

app_without_warning <- function() {
  data <- within(teal_data(), {
    IRIS <- iris
  })
  datanames(data) <- "IRIS"
  app <- init(data = data, modules = example_module())
  shinyApp(app$ui, app$server)
}

app_with_warning <- function() {
  data <- teal_data(IRIS = iris)
  app <- init(data = data, modules = example_module())
  shinyApp(app$ui, app$server)
}

# Expectation: This should create an app without a warning
app_without_warning()

# Expectation: This should create an app with a warning
app_with_warning()

sessionInfo()

R version 4.3.2 (2023-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.2.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Asia/Kolkata
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] teal_0.14.0.9040      testthat_3.2.1        teal.slice_0.4.0.9034 teal.data_0.3.0.9041 
[5] teal.code_0.5.0.9001  shiny_1.8.0          

loaded via a namespace (and not attached):
 [1] xfun_0.41                bslib_0.6.1              shinyjs_2.1.0           
 [4] htmlwidgets_1.6.4        teal.widgets_0.4.2.9001  devtools_2.4.5          
 [7] remotes_2.4.2.1          vctrs_0.6.5              tools_4.3.2             
[10] generics_0.1.3           tibble_3.2.1             fansi_1.0.6             
[13] pkgconfig_2.0.3          checkmate_2.3.1          desc_1.4.3              
[16] lifecycle_1.0.4          compiler_4.3.2           stringr_1.5.1           
[19] brio_1.1.4               fontawesome_0.5.2        httpuv_1.6.13           
[22] shinyWidgets_0.8.1       htmltools_0.5.7          usethis_2.2.2           
[25] sass_0.4.8               yaml_2.3.8               later_1.3.2             
[28] pillar_1.9.0             jquerylib_0.1.4          urlchecker_1.0.1        
[31] ellipsis_0.3.2           cachem_1.0.8             sessioninfo_1.2.2       
[34] mime_0.12                tidyselect_1.2.0         digest_0.6.34           
[37] stringi_1.8.3            dplyr_1.1.4              purrr_1.0.2             
[40] rprojroot_2.0.4          fastmap_1.1.1            grid_4.3.2              
[43] cli_3.6.2                logger_0.2.2             magrittr_2.0.3          
[46] pkgbuild_1.4.3           utf8_1.2.4               withr_3.0.0             
[49] teal.reporter_0.2.1.9013 promises_1.2.1           backports_1.4.1         
[52] rmarkdown_2.25           memoise_2.0.1            evaluate_0.23           
[55] knitr_1.45               shinycssloaders_1.0.0    miniUI_0.1.1.1          
[58] profvis_0.3.8            rlang_1.1.3              Rcpp_1.0.12             
[61] xtable_1.8-4             glue_1.7.0               formatR_1.14            
[64] pkgload_1.3.4            rstudioapi_0.15.0        jsonlite_1.8.8          
[67] teal.logger_0.1.3.9010   R6_2.5.1                 fs_1.6.3

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.
@vedhav vedhav added bug Something isn't working core labels Jan 25, 2024
@vedhav vedhav self-assigned this Jan 25, 2024
vedhav added a commit that referenced this issue Jan 25, 2024
Part of #1069 

Please make sure that you also use the `teal.data` branch
`1069-fix-code-warnings-when-data-is-verified@main` for testing the
example from the issue.

---------

Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com>
@m7pr
Copy link
Contributor

m7pr commented Jan 25, 2024

nice catch

@donyunardi donyunardi mentioned this issue Jan 26, 2024
36 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core
Projects
None yet
2 participants