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

improve label functions #244

Conversation

chlebowa
Copy link
Contributor

@chlebowa chlebowa commented Jan 3, 2024

Rewrote col_labels, col_;labels<- and col_relabel.
All existing unit tests pass.

This is only a suggestion, the functions do their job properly. They have been copied from formatters, which is an argument against these changes.

@chlebowa chlebowa added the core label Jan 3, 2024
@chlebowa chlebowa requested a review from donyunardi January 3, 2024 23:07
@chlebowa chlebowa closed this Jan 3, 2024
@chlebowa chlebowa reopened this Jan 3, 2024
@chlebowa chlebowa changed the base branch from main to pre-release-cleanup@main January 3, 2024 23:09
Copy link
Contributor

github-actions bot commented Jan 3, 2024

badge

Code Coverage Summary

Filename                         Stmts    Miss  Cover    Missing
-----------------------------  -------  ------  -------  -------------------
R/cdisc_data.R                       1       1  0.00%    37
R/default_cdisc_join_keys.R         11      11  0.00%    17-35
R/deprecated.R                      69      69  0.00%    16-356
R/dummy_function.R                   5       5  0.00%    16-23
R/formatters_var_labels.R           36      11  69.44%   59, 68-79
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%   33-36
R/join_keys.R                       21       0  100.00%
R/teal_data-class.R                 25       1  96.00%   70
R/teal_data-datanames.R             10       0  100.00%
R/teal_data-get_code.R              15       1  93.33%   57
R/teal_data-show.R                   4       4  0.00%    13-18
R/teal_data.R                       22       9  59.09%   32, 41-47, 50
R/testhat-helpers.R                 26       0  100.00%
R/topological_sort.R                32       0  100.00%
R/utils-get_code_dependency.R      110       1  99.09%   43
R/utils.R                           14       0  100.00%
R/verify.R                          42      11  73.81%   66, 96-100, 103-107
R/zzz.R                             10      10  0.00%    4-16
TOTAL                              794     137  82.75%

Diff against main

Filename                     Stmts    Miss  Cover
-------------------------  -------  ------  -------
R/formatters_var_labels.R      -15     -40  +69.44%
TOTAL                          -15     -40  +4.62%

Results for commit: 7bcdbb3

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Contributor

github-actions bot commented Jan 3, 2024

Unit Tests Summary

  1 files   15 suites   1s ⏱️
176 tests 174 ✅ 2 💤 0 ❌
257 runs  255 ✅ 2 💤 0 ❌

Results for commit 7bcdbb3.

Copy link
Contributor

github-actions bot commented Jan 3, 2024

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
formatters_var_labels 👶 $+0.04$ $+8$ $0$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
formatters_var_labels 👶 $+0.01$ col_labels_accepts_an_empty_data.frame
formatters_var_labels 👶 $+0.00$ col_labels_returns_a_named_vector_of_NA_when_fill_FALSE_and_there_are_no_labels
formatters_var_labels 👶 $+0.00$ col_labels_returns_a_vector_of_column_names_when_fill_TRUE_and_there_are_no_labels
formatters_var_labels 👶 $+0.00$ col_labels_returns_empty_character_vector_for_a_data.frame_with_no_columns
formatters_var_labels 👶 $+0.01$ col_relabel_correctly_changes_column_labels_in_a_data_frame
formatters_var_labels 👶 $+0.00$ col_relabel_returns_the_original_data.frame_when_no_new_labels_are_specified
formatters_var_labels 👶 $+0.01$ col_relabel_throws_an_error_for_non_existent_columns

Results for commit 4b796a8

♻️ 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.

👍 I hope there is no other data.frame alike widely used class. We can always add it in the future if needed.

@chlebowa chlebowa merged commit 4d238d3 into pre-release-cleanup@main Jan 8, 2024
@chlebowa chlebowa deleted the improve_label_functions@pre-release-cleanup@main branch January 8, 2024 14:23
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.

2 participants