insightsengineering / teal.data

Data model for teal applications
https://insightsengineering.github.io/teal.data/
Other
8 stars 7 forks source link

288 allow ellipsis in `get_code` #290

Closed m7pr closed 7 months ago

m7pr commented 7 months ago

Close #288

Allows to pass more parameters in get_code through .... For example you can now pass check_names

code <- c(
  "a <- 1",
  "b <- identity(x = a)",
  "a <- 2"
)
tdata <- eval_code(teal_data(), code)
get_code(tdata, datanames = "c", check_names = TRUE)
#> character(0)
Warning message:
In get_code_dependency(object@code, datanames, ...) :
  Object(s) not found in code: c

get_code(tdata, datanames = "c", check_names = FALSE)
#> character(0)
github-actions[bot] commented 7 months ago

badge

Code Coverage Summary

Filename                         Stmts    Miss  Cover    Missing
-----------------------------  -------  ------  -------  --------------------
R/cdisc_data.R                       1       0  100.00%
R/deprecated.R                      57      57  0.00%    19-344
R/dummy_function.R                   2       2  0.00%    14-15
R/formatters_var_labels.R           36      11  69.44%   60, 69-80
R/join_key.R                        38       0  100.00%
R/join_keys-c.R                     12       0  100.00%
R/join_keys-extract.R              128       0  100.00%
R/join_keys-names.R                 15       0  100.00%
R/join_keys-parents.R               30       0  100.00%
R/join_keys-print.R                 45       0  100.00%
R/join_keys-utils.R                 73       3  95.89%   35-38
R/join_keys.R                       21       0  100.00%
R/teal_data-class.R                 25       1  96.00%   69
R/teal_data-datanames.R             10       0  100.00%
R/teal_data-get_code.R              14       0  100.00%
R/teal_data-show.R                   4       4  0.00%    14-19
R/teal_data.R                       30      16  46.67%   34, 37-43, 53-59, 62
R/testhat-helpers.R                 26       0  100.00%
R/topological_sort.R                32       0  100.00%
R/utils-get_code_dependency.R      184       1  99.46%   275
R/verify.R                          42      11  73.81%   63, 93-97, 100-104
TOTAL                              825     106  87.15%

Diff against main

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

Results for commit: 8fec7927f8c2ad3856308474e751a16fe60d5e4e

Minimum allowed coverage is 80%

:recycle: This comment has been updated with latest results

github-actions[bot] commented 7 months ago

Unit Tests Summary

  1 files   14 suites   1s :stopwatch: 177 tests 175 :white_check_mark: 2 :zzz: 0 :x: 247 runs  245 :white_check_mark: 2 :zzz: 0 :x:

Results for commit 8fec7927.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 7 months ago

Unit Test Performance Difference

Additional test case details | Test Suite | $Status$ | Time on `main` | $±Time$ | Test Case | |:-----|:----:|:----:|:----:|:-----| | get_code | 💀 | $0.02$ | $-0.02$ | does_not_break_if_object_is_used_in_a_function_on_lhs | | get_code | 💀 | $0.01$ | $-0.01$ | does_not_break_if_object_is_used_in_a_function_on_lhs_and_influencers_are_both_on_lhs_and_rhs |

Results for commit 6ad7af487587a7ce17f16390bcfb4270e5f5cd0b

♻️ This comment has been updated with latest results.

pawelru commented 7 months ago

The change is significant. Please add NEWS enty

m7pr commented 7 months ago

I did update NEWS under 0.4.0.9003 version, but this needs to be moved to something higher, after 0.4.1 is released https://github.com/insightsengineering/teal.data/pull/294 and this is not yet merged.