Skip to content

Conversation

@averissimo
Copy link
Contributor

Pull Request

Fixes of #676

Changes description

  • Only check for conditions for warning after calculating "pretty" range

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

badge

Code Coverage Summary

Filename                        Stmts    Miss  Cover    Missing
----------------------------  -------  ------  -------  -------------------------------------------------------------------------------------------------------------------------
R/calls_combine_by.R                7       0  100.00%
R/choices_labeled.R                23       1  95.65%   34
R/count_labels.R                  126       0  100.00%
R/filter_panel_api.R               27       1  96.30%   132
R/FilteredData-utils.R             58      17  70.69%   38-43, 139, 161-170
R/FilteredData.R                  522     118  77.39%   109, 138, 186, 325, 397, 484-493, 514, 532-590, 610-613, 657, 712-728, 873, 885-905
R/FilteredDataset-utils.R          23       1  95.65%   125
R/FilteredDataset.R               264       5  98.11%   49, 154, 189, 214-215
R/FilteredDatasetDataframe.R      123       3  97.56%   87, 148, 158
R/FilteredDatasetDefault.R         18       4  77.78%   104-117
R/FilteredDatasetMAE.R            133      15  88.72%   56, 118-123, 160-165, 169-170
R/FilterPanelAPI.R                 10       0  100.00%
R/FilterState-utils.R             101       2  98.02%   264, 294
R/FilterState.R                   366      21  94.26%   91, 155, 266-267, 273-274, 328, 330, 416, 632, 675-679, 698, 762-768, 779
R/FilterStateChoices.R            349      10  97.13%   303, 426-429, 541-544, 589
R/FilterStateDate.R               221      46  79.19%   233, 361-371, 382-387, 391-396, 404-419, 438-445
R/FilterStateDatettime.R          316     206  34.81%   269, 321-559
R/FilterStateEmpty.R               53      31  41.51%   89, 99-104, 117, 129-169
R/FilterStateExpr.R                81       1  98.77%   244
R/FilterStateLogical.R            201     149  25.87%   139, 161, 221, 225-414
R/FilterStateRange.R              411     121  70.56%   264, 386, 497-504, 507-517, 520, 531-537, 548-560, 564-574, 578-580, 593-619, 634-641, 644-651, 665-682, 717-722, 732-734
R/FilterStates-utils.R             70       7  90.00%   108, 127, 188-194
R/FilterStates.R                  379      19  94.99%   63, 92-96, 208, 425, 470, 559-563, 608, 726-729
R/FilterStatesDF.R                  5       0  100.00%
R/FilterStatesMAE.R                10       1  90.00%   40
R/FilterStatesMatrix.R              7       0  100.00%
R/FilterStatesSE.R                171      47  72.51%   36, 73-75, 85-87, 119, 191-201, 213-223, 230-237, 245-252, 259
R/include_css_js.R                  5       0  100.00%
R/teal_slice.R                    108       1  99.07%   206
R/teal_slices.R                    88       5  94.32%   152-157
R/test_utils.R                     21       0  100.00%
R/utils.R                          29       0  100.00%
R/variable_types.R                 15       1  93.33%   48
R/zzz.R                            16      16  0.00%    3-46
TOTAL                            4357     849  80.51%

Diff against main

Filename                Stmts    Miss  Cover
--------------------  -------  ------  -------
R/FilterStateRange.R       +2       0  +0.14%
TOTAL                      +2       0  +0.01%

Results for commit: e92104e

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

Unit Tests Summary

  1 files   31 suites   37s ⏱️
414 tests 399 ✅ 15 💤 0 ❌
875 runs  860 ✅ 15 💤 0 ❌

Results for commit e92104e.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
FilteredData 💚 $25.27$ $-4.65$ $0$ $0$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
RangeFilterState 👶 $+0.08$ constructor_modifies_choices_and_does_not_throw_error_when_re_used
RangeFilterState 👶 $+0.04$ constructor_modifies_choices_and_throws_warning_when_manually_calculated_with_range_x_
RangeFilterState 👶 $+0.05$ constructor_modifies_choices_that_are_automatically_calculated_to_better_fit_the_tick_on_the_slider

Results for commit 32edb24

♻️ This comment has been updated with latest results.

Copy link
Contributor

@llrs-roche llrs-roche left a comment

Choose a reason for hiding this comment

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

Looks good. Key change I think is on https://github.com/insightsengineering/teal.slice/pull/677/changes#diff-83c9e316098506afac069a38830850c5a3bcd979de2f8eb540787de4c5af946cR288.

The app didn't produce the warnings with this patch. Thanks for adding the NEWS entry

@llrs-roche llrs-roche self-assigned this Feb 11, 2026
)
})

testthat::describe("constructor modifies choices", {
Copy link
Contributor

@llrs-roche llrs-roche Feb 11, 2026

Choose a reason for hiding this comment

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

Loading main and running the new tests on this branch leds to: ! Test failed with 2 failures and 1 success.:

── Failure: constructor modifies choices / and throws warning when manually calculated with range(x) ──
Expected `RangeFilterState$new(...)` to produce warnings.
── Failure: constructor modifies choices / and does not throw error when re-used ──

Copy link
Contributor

@llrs-roche llrs-roche Feb 11, 2026

Choose a reason for hiding this comment

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

Thinking about what prompted me to refer to tests: could we test this with some NA and some Inf and (?) imaginary numbers (check ?Re): 0i ^ (-3:3). Just to be sure if we can further simplify the is.na | !is.finite

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