diff --git a/R/telemetry.R b/R/telemetry.R index 41c2eb9e..2937ba6f 100644 --- a/R/telemetry.R +++ b/R/telemetry.R @@ -231,8 +231,12 @@ expr_to_json <- function(x, name_map) { expr_scrub <- function(x, name_map) { do_scrub <- function(xx, callee = FALSE) { - if (is.null(xx)) { - return(NULL) + if (is.character(xx)) { + return("") + } else if (is.factor(xx)) { + return("") + } else if (is.atomic(xx)) { + return(xx) } else if (is_symbol(xx)) { if (callee) { return(xx) diff --git a/tests/testthat/_snaps/fallback.md b/tests/testthat/_snaps/fallback.md index 0b355ebc..b432bfe3 100644 --- a/tests/testthat/_snaps/fallback.md +++ b/tests/testthat/_snaps/fallback.md @@ -81,7 +81,7 @@ a, label = TRUE)) Message i dplyr fallback recorded - {"version":"0.3.1","message":"wday(label = ) not supported","name":"mutate","x":{"...1":"Date"},"args":{"dots":{"...2":"...3::...4(...1, label = \"Don't know how to scrub logical\")"},".by":"NULL",".keep":["all","used","unused","none"]}} + {"version":"0.3.1","message":"wday(label = ) not supported","name":"mutate","x":{"...1":"Date"},"args":{"dots":{"...2":"...3::...4(...1, label = TRUE)"},".by":"NULL",".keep":["all","used","unused","none"]}} Output # A tibble: 1 x 2 a b @@ -109,7 +109,7 @@ a, format = "%Y-%m-%d", tz = "CET")) Message i dplyr fallback recorded - {"version":"0.3.1","message":"strftime(tz = ) not supported","name":"mutate","x":{"...1":"Date"},"args":{"dots":{"...2":"strftime(...1, format = \"Don't know how to scrub character\", tz = \"Don't know how to scrub character\")"},".by":"NULL",".keep":["all","used","unused","none"]}} + {"version":"0.3.1","message":"strftime(tz = ) not supported","name":"mutate","x":{"...1":"Date"},"args":{"dots":{"...2":"strftime(...1, format = \"\", tz = \"\")"},".by":"NULL",".keep":["all","used","unused","none"]}} Output # A tibble: 1 x 2 a b diff --git a/tests/testthat/_snaps/telemetry.md b/tests/testthat/_snaps/telemetry.md index a3aafb09..92560bef 100644 --- a/tests/testthat/_snaps/telemetry.md +++ b/tests/testthat/_snaps/telemetry.md @@ -56,7 +56,7 @@ tibble(a = 1:3, b = 4:6) %>% as_duckplyr_df() %>% filter(a > 1, .by = b) Condition Error in `rel_try()`: - ! filter: {"version":"0.3.1","message":"Error in filter","name":"filter","x":{"...1":"integer","...2":"integer"},"args":{"dots":{"1":"...1 > \"Don't know how to scrub numeric\""},"by":"...2","preserve":false}} + ! filter: {"version":"0.3.1","message":"Error in filter","name":"filter","x":{"...1":"integer","...2":"integer"},"args":{"dots":{"1":"...1 > 1"},"by":"...2","preserve":false}} --- @@ -64,7 +64,7 @@ tibble(a = 1:3, b = 4:6) %>% as_duckplyr_df() %>% filter(a > 1, .preserve = TRUE) Condition Error in `rel_try()`: - ! filter: {"version":"0.3.1","message":"Error in filter","name":"filter","x":{"...1":"integer","...2":"integer"},"args":{"dots":{"1":"...1 > \"Don't know how to scrub numeric\""},"by":"NULL","preserve":true}} + ! filter: {"version":"0.3.1","message":"Error in filter","name":"filter","x":{"...1":"integer","...2":"integer"},"args":{"dots":{"1":"...1 > 1"},"by":"NULL","preserve":true}} # telemetry and full_join()