From 79b75c224049023b8887941d5534100ca40f03f5 Mon Sep 17 00:00:00 2001
From: Vedha Viyash <49812166+vedhav@users.noreply.github.com>
Date: Tue, 10 Dec 2024 14:08:14 +0530
Subject: [PATCH 1/2] Fix windows build in r-universe (#632)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes the [package build in
windows](https://github.com/r-universe/pharmaverse/actions/runs/12161651762/job/33917098250)
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 🐛
``` r
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](https://reprex.tidyverse.org)
#### Linux reprex 👌
``` r
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](https://reprex.tidyverse.org)
#### macOS reprex 👌
``` r
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](https://reprex.tidyverse.org/)
---
R/utils.R | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/R/utils.R b/R/utils.R
index d29cb9b7b..0728d80a5 100644
--- a/R/utils.R
+++ b/R/utils.R
@@ -84,7 +84,7 @@ make_c_call <- function(choices) {
sanitize_id <- function(id) {
pattern_escape <- "[^0-9A-Za-z_]"
- id_new <- gsub(pattern_escape, "_", id)
+ id_new <- gsub(pattern_escape, "_", id, perl = TRUE)
hashes <- vapply(id[id != id_new], rlang::hash, character(1), USE.NAMES = FALSE)
id[id != id_new] <- paste0("h", substr(hashes, 1, 4), "_", id_new[id != id_new])
From c02c04d2e6ed29294095cdb9fc521b348f2f887a Mon Sep 17 00:00:00 2001
From: vedhav
Date: Tue, 10 Dec 2024 08:39:27 +0000
Subject: [PATCH 2/2] [skip actions] Bump version to 0.5.1.9018
---
DESCRIPTION | 4 ++--
NEWS.md | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/DESCRIPTION b/DESCRIPTION
index fcd8a8e91..7e720ce61 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,8 +1,8 @@
Type: Package
Package: teal.slice
Title: Filter Module for 'teal' Applications
-Version: 0.5.1.9017
-Date: 2024-12-04
+Version: 0.5.1.9018
+Date: 2024-12-10
Authors@R: c(
person("Dawid", "Kaledkowski", , "dawid.kaledkowski@roche.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-9533-457X")),
diff --git a/NEWS.md b/NEWS.md
index e0dde04b3..e16b9f863 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,4 +1,4 @@
-# teal.slice 0.5.1.9017
+# teal.slice 0.5.1.9018
### Enhancements