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

Fix windows build in r-universe #632

Merged
merged 1 commit into from
Dec 10, 2024
Merged

Fix windows build in r-universe #632

merged 1 commit into from
Dec 10, 2024

Conversation

vedhav
Copy link
Contributor

@vedhav vedhav commented Dec 10, 2024

Fixes the package build in windows due to test failure.

Root cause

Non-Perl compatible regex was causing different behavior when Unicode text was used as id for the namespace.

As far as I know using perl compatible regex is recommended for complex regex (like using lookbehind) or when dealing with unicode characters, the only advantage of non-perl compatible regex is that it performs better and we do not have a performance issue in our case as we're dealing with a small vector of texts.

Windows reprex 🐛

pattern_escape <- "[^0-9A-Za-z_]"
id <- "\U5F4AA"
gsub(pattern_escape, "_", id, perl = FALSE)
#> [1] "__"
gsub(pattern_escape, "_", id, perl = TRUE)
#> [1] "_"

Created on 2024-12-10 with reprex v2.1.1

Linux reprex 👌

pattern_escape <- "[^0-9A-Za-z_]"
id <- "\U5F4AA"
gsub(pattern_escape, "_", id, perl = FALSE)
#> [1] "_"
gsub(pattern_escape, "_", id, perl = TRUE)
#> [1] "_"

Created on 2024-12-10 with reprex v2.0.2

macOS reprex 👌

pattern_escape <- "[^0-9A-Za-z_]"
id <- "\U1F4AA"
gsub(pattern_escape, "_", id, perl = FALSE)
#> [1] "_"
gsub(pattern_escape, "_", id, perl = TRUE)
#> [1] "_"

Created on 2024-12-10 with reprex v2.1.0

@vedhav vedhav added bug Something isn't working core labels Dec 10, 2024
Copy link
Contributor

github-actions bot commented Dec 10, 2024

Unit Tests Summary

  1 files   29 suites   22s ⏱️
367 tests 367 ✅ 0 💤 0 ❌
819 runs  819 ✅ 0 💤 0 ❌

Results for commit c1f5c3c.

♻️ This comment has been updated with latest results.

Copy link
Contributor

badge

Code Coverage Summary

Filename                        Stmts    Miss  Cover    Missing
----------------------------  -------  ------  -------  -----------------------------------------------------------------------------------------------------------------------
R/calls_combine_by.R                7       0  100.00%
R/choices_labeled.R                49      14  71.43%   25, 36, 41, 51-56, 68, 72-76
R/count_labels.R                  102       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                  537     186  65.36%   110, 184, 323, 395, 500-508, 531, 550-593, 613-616, 657, 693, 713-745, 768-770, 773-787, 791-801, 804-847, 904, 916-938
R/FilteredDataset-utils.R          23       1  95.65%   125
R/FilteredDataset.R               230      72  68.70%   48, 147, 179, 206-276, 378
R/FilteredDatasetDataframe.R      120       8  93.33%   87, 148, 158, 233-237
R/FilteredDatasetDefault.R         18       4  77.78%   104-117
R/FilteredDatasetMAE.R            133      37  72.18%   56, 117-122, 159-164, 168-169, 187-209
R/FilterPanelAPI.R                 10       0  100.00%
R/FilterState-utils.R             101       2  98.02%   264, 294
R/FilterState.R                   361      61  83.10%   89, 213, 231-235, 242-243, 257-258, 264-265, 319, 321, 323, 375, 418, 639, 682-705, 715-734, 769-775, 784-790
R/FilterStateChoices.R            352     109  69.03%   301, 368-375, 379-396, 423-426, 439-450, 462-470, 474-503, 523-526, 529-532, 542-567, 578, 583, 594
R/FilterStateDate.R               213     127  40.38%   230, 282-437
R/FilterStateDatettime.R          307     197  35.83%   266, 318-547
R/FilterStateEmpty.R               53      31  41.51%   89, 99-104, 117, 129-169
R/FilterStateExpr.R                81      66  18.52%   167-278
R/FilterStateLogical.R            194     142  26.80%   136, 158, 218, 222-404
R/FilterStateRange.R              410     104  74.63%   262, 384, 517-521, 524-534, 537, 548-554, 565-577, 581-591, 595-597, 610-636, 651, 654, 668-685, 720-725, 735-737
R/FilterStates-utils.R             70       7  90.00%   108, 127, 188-194
R/FilterStates.R                  372      32  91.40%   63, 89-93, 205, 327-336, 421-424, 467, 504, 564-568, 613, 734-737
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                216      62  71.30%   36, 73-75, 85-87, 110-117, 125-132, 208, 233, 252-270, 278-296, 303
R/include_css_js.R                  5       5  0.00%    12-16
R/teal_slice.R                    107       4  96.26%   131, 195-196, 206
R/teal_slices.R                    84       5  94.05%   150-155
R/test_utils.R                     21       0  100.00%
R/utils.R                          26       0  100.00%
R/variable_types.R                 15       1  93.33%   48
R/zzz.R                            17      17  0.00%    3-47
TOTAL                            4341    1313  69.75%

Diff against main

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

Results for commit: c1f5c3c

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@gogonzo gogonzo self-assigned this Dec 10, 2024
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.

👍

@vedhav vedhav merged commit 79b75c2 into main Dec 10, 2024
26 checks passed
@vedhav vedhav deleted the fix-windows-build@main branch December 10, 2024 08:38
@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants