Skip to content

Fix ‘sym_cond > ass_cond’: longer object - #236

Merged
m7pr merged 4 commits into
mainfrom
235_ass_cond@main
Nov 29, 2024
Merged

Fix ‘sym_cond > ass_cond’: longer object #236
m7pr merged 4 commits into
mainfrom
235_ass_cond@main

Conversation

@m7pr

@m7pr m7pr commented Nov 27, 2024

Copy link
Copy Markdown
Contributor

Fixes #235

There was a warning thrown by the get_code_dependency that is now not visible + the code extraction works for for loops.

Added 2 tests to prove that.

No warning shown during

devtools::load_all("../teal.code")
devtools::load_all("../teal")
devtools::load_all(".")
footnote_regression <- teal_transform_module(
  server = make_teal_transform_server(expression(
    plot <- plot + labs(caption = deparse(summary(fit)[[1]]))
  ))
)

data <- teal_data()
data <- within(data, {
  require(nestcolor)
  ADSL <- rADSL
})
join_keys(data) <- default_cdisc_join_keys[names(data)]

app <- init(
  data = data,
  modules = modules(
    tm_a_regression(
      label = "Regression",
      response = data_extract_spec(
        dataname = "ADSL",
        select = select_spec(
          label = "Select variable:",
          choices = "BMRKR1",
          selected = "BMRKR1",
          multiple = FALSE,
          fixed = TRUE
        )
      ),
      regressor = data_extract_spec(
        dataname = "ADSL",
        select = select_spec(
          label = "Select variables:",
          choices = variable_choices(data[["ADSL"]], c("AGE", "SEX", "RACE")),
          selected = "AGE",
          multiple = TRUE,
          fixed = FALSE
        )
      ),
      decorators = list(footnote_regression)
    )
  )
)
if (interactive()) {
  shinyApp(app$ui, app$server)
}

@github-actions

github-actions Bot commented Nov 27, 2024

Copy link
Copy Markdown
Contributor

badge

Code Coverage Summary

Filename                         Stmts    Miss  Cover    Missing
-----------------------------  -------  ------  -------  ---------
R/qenv-c.R                          55       0  100.00%
R/qenv-class.R                      12       0  100.00%
R/qenv-concat.R                      7       0  100.00%
R/qenv-constructor.R                 1       0  100.00%
R/qenv-errors.R                      4       4  0.00%    6-9
R/qenv-eval_code.R                  57       2  96.49%   107, 116
R/qenv-extract.R                    30       0  100.00%
R/qenv-get_code.R                   24       0  100.00%
R/qenv-get_env.R                     3       1  66.67%   27
R/qenv-get_messages.r                5       0  100.00%
R/qenv-get_var.R                    26       0  100.00%
R/qenv-get_warnings.R                5       0  100.00%
R/qenv-join.R                        7       7  0.00%    137-151
R/qenv-length.R                      2       1  50.00%   2
R/qenv-show.R                        1       1  0.00%    19
R/qenv-within.R                      8       0  100.00%
R/utils-get_code_dependency.R      200       2  99.00%   160, 258
R/utils.R                           30       0  100.00%
TOTAL                              477      18  96.23%

Diff against main

Filename                         Stmts    Miss  Cover
-----------------------------  -------  ------  -------
R/utils-get_code_dependency.R       +1       0  +0.01%
TOTAL                               +1       0  +0.01%

Results for commit: 8e50958

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions

github-actions Bot commented Nov 27, 2024

Copy link
Copy Markdown
Contributor

Unit Tests Summary

  1 files   12 suites   3s ⏱️
151 tests 148 ✅ 3 💤 0 ❌
231 runs  228 ✅ 3 💤 0 ❌

Results for commit 8e50958.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Nov 27, 2024

Copy link
Copy Markdown
Contributor

Unit Test Performance Difference

Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
qenv_get_code 👶 $+0.05$ objects_in_for_loop_are_extracted_if_passed_as_one_character
qenv_get_code 👶 $+0.03$ objects_in_for_loop_are_extracted_if_passed_as_separate_calls

Results for commit 59286d1

♻️ This comment has been updated with latest results.

@averissimo averissimo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I can't break it anymore 🎉

It needs a linter correction and I left an optional comment.

Comment thread R/utils-get_code_dependency.R Outdated
Comment thread tests/testthat/test-qenv_get_code.R Outdated
m7pr and others added 2 commits November 29, 2024 09:57
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>
@m7pr
m7pr enabled auto-merge (squash) November 29, 2024 08:57
@m7pr
m7pr merged commit 9cf1128 into main Nov 29, 2024
@m7pr
m7pr deleted the 235_ass_cond@main branch November 29, 2024 09:00
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: [WARN] In ‘sym_cond > ass_cond’: longer object length is not a multiple of shorter object length

2 participants