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

Revert square bracket@main #553

Merged
merged 2 commits into from
Aug 3, 2023
Merged

Revert square bracket@main #553

merged 2 commits into from
Aug 3, 2023

Conversation

gogonzo
Copy link
Contributor

@gogonzo gogonzo commented Aug 3, 2023

reverted replace of square bracket by get_var. Problem with get_var is as follows.

  • get_var(object = qenv(), object = "varname") is dispatched on object and there are variants for qenv and qenv.error. Sometimes qenv() can be a shiny-validation-error which causes error message like no get_var method for object error bla bla.
  • [[ is generic exported from base and we have extra [[.qenv and [[.qenverror and this function have also other variants created in base - so that it doesn't fail when calling <simpleError>[["varname"]]

It means that to fix problem of plot printed to devide we need to use teal.code::supress_dev() in specific cases. We don't need to depend on a get_var

@gogonzo gogonzo added the core label Aug 3, 2023
@kartikeyakirar
Copy link
Contributor

kartikeyakirar commented Aug 3, 2023

@gogonzo Initially, we converted the [[ call to get_var to prevent the plot from being printed to the IDE. Now, if we're replacing this call, shouldn't we include a call to dev_suppress to maintain the suppression of plot printing?

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

Unit Tests Summary

  1 files    5 suites   0s ⏱️
16 tests 16 ✔️ 0 💤 0
49 runs  49 ✔️ 0 💤 0

Results for commit 2cdee21.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

badge

Code Coverage Summary

Filename                      Stmts    Miss  Cover    Missing
--------------------------  -------  ------  -------  ----------------------------------------------
R/tm_a_pca.R                    828     828  0.00%    72-1024
R/tm_a_regression.R             712     712  0.00%    92-887
R/tm_data_table.R               171     171  0.00%    58-281
R/tm_file_viewer.R              172     172  0.00%    39-241
R/tm_front_page.R               127     116  8.66%    63-205
R/tm_g_association.R            331     331  0.00%    89-478
R/tm_g_bivariate.R              652     492  24.54%   124-702, 750, 756, 760, 871, 888, 906, 926-948
R/tm_g_distribution.R          1025    1025  0.00%    110-1257
R/tm_g_response.R               347     347  0.00%    85-496
R/tm_g_scatterplot.R            716     716  0.00%    160-967
R/tm_g_scatterplotmatrix.R      278     259  6.83%    78-373, 427, 441
R/tm_missing_data.R            1034    1034  0.00%    58-1228
R/tm_outliers.R                 944     944  0.00%    76-1142
R/tm_t_crosstable.R             252     252  0.00%    81-371
R/tm_variable_browser.R         815     810  0.61%    61-1293
R/utils.R                       122     122  0.00%    74-351
R/zzz.R                           1       1  0.00%    2
TOTAL                          8527    8332  2.29%

Diff against main

Filename      Stmts    Miss  Cover
----------  -------  ------  --------
TOTAL             0       0  +100.00%

Results for commit: 41cac8f

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@gogonzo
Copy link
Contributor Author

gogonzo commented Aug 3, 2023

@gogonzo Initially, we converted the [[ call to get_var to prevent the plot from being printed to the IDE. Now, if we're replacing this call, shouldn't we include a call to dev_suppress to maintain the suppression of plot printing?

dev_supress should be used only when plot is sent anywhere but plotOutput. We have only one situation in tmg where plot is sent to renderText.

@kartikeyakirar
Copy link
Contributor

In addition to this needs to be refactored in teal.modules.clinical as well.

@gogonzo gogonzo merged commit 907aa7f into main Aug 3, 2023
@gogonzo gogonzo deleted the revert_square_bracket@main branch August 3, 2023 10:09
kartikeyakirar added a commit to insightsengineering/teal.modules.clinical that referenced this pull request Aug 4, 2023
this PR fixes
#799
and PR is related to issue
insightsengineering/teal.code#84

======================================================

based on this PR
insightsengineering/teal.modules.general#553
teal.code::dev_suppress() is used to avoid printing plot on console.

---------

Co-authored-by: kartikeya <kartikeya.kirar@unicle.life>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants