Skip to content

{teal} module returns a teal_report object that extends from teal_data #255

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

averissimo
Copy link
Contributor

@averissimo averissimo commented Jun 3, 2025

Pull Request

Fixes:

Built on top of:

Companion PRs:

Changes description

  • Add new parameter cache
    • Caches the result of the last evaluation in the respective @code slot
    • Decide on name
  • Remove signature with multiple arguments to allow overriding eval_code in other packages without showing a note
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

Created on 2025-06-03 with reprex v2.1.1

Code balance is + because I've added one test ;]
@averissimo averissimo marked this pull request as ready for review June 5, 2025 13:11
Copy link
Contributor

github-actions bot commented Jun 5, 2025

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                  65       2  96.92%   42, 68
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                       29      29  0.00%    19-50
R/qenv-within.R                      8       0  100.00%
R/utils-get_code_dependency.R      245       2  99.18%   160, 258
R/utils.R                           30       0  100.00%
TOTAL                              558      46  91.76%

Diff against main

Filename              Stmts    Miss  Cover
------------------  -------  ------  -------
R/qenv-eval_code.R       +3       0  +0.15%
TOTAL                    +3       0  +0.04%

Results for commit: 5605340

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Contributor

github-actions bot commented Jun 5, 2025

Unit Tests Summary

  1 files   13 suites   4s ⏱️
157 tests 154 ✅ 3 💤 0 ❌
245 runs  242 ✅ 3 💤 0 ❌

Results for commit 5605340.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Jun 5, 2025

Unit Test Performance Difference

Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
qenv_eval_code 💀 $0.01$ $-0.01$ Code_executed_with_integer_shorthand_1L_is_the_same_as_original
qenv_eval_code 👶 $+0.02$ eval_code_fails_with_code_not_being_language_nor_character
qenv_eval_code 💀 $0.01$ $-0.01$ eval_code_fails_with_unquoted_expression
qenv_eval_code 👶 $+0.00$ eval_code_ignores_empty_code
qenv_within 👶 $+0.01$ Code_executed_with_integer_shorthand_1L_is_the_same_as_original

Results for commit 0da42f3

♻️ This comment has been updated with latest results.

m7pr and others added 2 commits June 6, 2025 14:26
Companion to
insightsengineering/teal.reporter#334
Consequence of changing naming convention for `teal_report` object.
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