Skip to content

Commit

Permalink
Show atomics used in expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Mar 9, 2024
1 parent 7cab067 commit b6303f1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions R/telemetry.R
Original file line number Diff line number Diff line change
Expand Up @@ -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("<character>")
} else if (is.factor(xx)) {
return("<factor>")
} else if (is.atomic(xx)) {
return(xx)
} else if (is_symbol(xx)) {
if (callee) {
return(xx)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/_snaps/fallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = \"<character>\", tz = \"<character>\")"},".by":"NULL",".keep":["all","used","unused","none"]}}
Output
# A tibble: 1 x 2
a b
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/_snaps/telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@
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}}

---

Code
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()

Expand Down

0 comments on commit b6303f1

Please sign in to comment.