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]: assert_flag_variables() does not work properly #246

Open
jknizia opened this issue Jan 8, 2025 · 0 comments
Open

[Bug]: assert_flag_variables() does not work properly #246

jknizia opened this issue Jan 8, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@jknizia
Copy link
Collaborator

jknizia commented Jan 8, 2025

What happened?

Example:
adae <- random.cdisc.data::cadae
assert_flag_variables(adae, "AESER") --> returns FALSE

The second line of example code should not return FALSE, since

a) AESER is indeed a flag variable only containing "Y" and "N" values. Thus the assertion should return "AESER" as common assert_*() functions do

b) The expected behaviour of a common assert_*() function is to throw an informative error in case the assertion is not met. Our cardinal assert function assert_flag_variables() does not throw an error, but rather returns FALSE silently, allowing the script to proceed. This should be changed since the purpose of such a function is to force users to correct their inputs.

sessionInfo()

sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.utf8  LC_CTYPE=German_Germany.utf8    LC_MONETARY=German_Germany.utf8 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.utf8    

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

other attached packages:
[1] cardinal_0.1.0.9064 testthat_3.1.10     tern_0.9.5          rtables_0.6.9       magrittr_2.0.3      formatters_0.5.8   

loaded via a namespace (and not attached):
 [1] httr_1.4.5               pkgload_1.3.2            tidyr_1.3.1              jsonlite_1.8.7           splines_4.2.2            brio_1.1.3              
 [7] assertthat_0.2.1         shiny_1.7.5              Rdpack_2.4               cards_0.4.0              remotes_2.4.2            sessioninfo_1.2.2       
[13] pillar_1.9.0             backports_1.4.1          lattice_0.20-45          cardx_0.2.2              glue_1.8.0               digest_0.6.31           
[19] promises_1.2.0.1         rbibutils_2.2.13         checkmate_2.1.0          tfrmt_0.1.2              colorspace_2.1-0         cowplot_1.1.1           
[25] htmltools_0.5.8.1        httpuv_1.6.9             Matrix_1.5-1             pkgconfig_2.0.3          devtools_2.4.5           broom_1.0.5             
[31] purrr_1.0.2              xtable_1.8-4             scales_1.3.0             processx_3.8.2           later_1.3.0              ggsurvfit_1.1.0         
[37] timechange_0.2.0         tibble_3.2.1             generics_0.1.3           ggplot2_3.5.1            usethis_2.1.6            ellipsis_0.3.2          
[43] gtsummary_2.0.4          cachem_1.0.7             withr_3.0.0              rlistings_0.2.9          Tplyr_1.2.1              cli_3.6.3               
[49] survival_3.7-0           crayon_1.5.2             mime_0.12                memoise_2.0.1            ps_1.7.2                 fs_1.6.5                
[55] fansi_1.0.6              forcats_1.0.0            xml2_1.3.6               pkgbuild_1.4.0           profvis_0.3.7            tools_4.2.2             
[61] prettyunits_1.1.1        lifecycle_1.0.4          stringr_1.5.1            munsell_0.5.0            callr_3.7.3              random.cdisc.data_0.3.14
[67] compiler_4.2.2           rlang_1.1.4              grid_4.2.2               gt_0.11.1                rstudioapi_0.14          htmlwidgets_1.6.4       
[73] miniUI_0.1.1.1           gtable_0.3.3             R6_2.5.1                 lubridate_1.9.3          dplyr_1.1.4              fastmap_1.1.1           
[79] utf8_1.2.4               rprojroot_2.0.3          desc_1.4.2               stringi_1.7.12           Rcpp_1.0.10              vctrs_0.6.5             
[85] tidyselect_1.2.1         urlchecker_1.0.1

Relevant log output

No response

@jknizia jknizia added the bug Something isn't working label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant