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

Merged
merged 15 commits into from
Jun 12, 2025

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                  62       1  98.39%   40
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                              555      45  91.89%

Diff against main

Filename              Stmts    Miss  Cover
------------------  -------  ------  -------
R/qenv-eval_code.R        0      -1  +1.61%
TOTAL                     0      -1  +0.18%

Results for commit: c4bf214

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 c4bf214.

♻️ 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 5c19905

♻️ This comment has been updated with latest results.

Copy link
Contributor

@gogonzo gogonzo left a comment

Choose a reason for hiding this comment

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

LGTM 👍
@pawelru we removed this controversial argument. We keep only ... for future methods

@averissimo averissimo merged commit 71b8960 into main Jun 12, 2025
29 checks passed
@averissimo averissimo deleted the teal_reportable branch June 12, 2025 14:44
@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2025
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.

4 participants