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

sum(..., na.rm = TRUE) creates a fall_back #205

Open
meersel opened this issue Jul 24, 2024 · 1 comment
Open

sum(..., na.rm = TRUE) creates a fall_back #205

meersel opened this issue Jul 24, 2024 · 1 comment

Comments

@meersel
Copy link

meersel commented Jul 24, 2024

Using the base sum() function with argument na.rm = TRUE creates an fall_back to dplyr.
The argument na.rm is not recognized.

Example code:

duckplyr::as_duckplyr_tibble(my_tbl) |>

summarise(
total_sales = sum(sales_col, na.rm = TRUE),

.by = c(country, item_number)

)

@hadley
Copy link
Member

hadley commented Jul 25, 2024

Rerprex:

library(dplyr, warn.conflicts = FALSE)
library(duckplyr, warn.conflicts = FALSE)
#> The duckplyr package is configured to fall back to dplyr when it encounters an
#> incompatibility. Fallback events can be collected and uploaded for analysis to
#> guide future development. By default, no data will be collected or uploaded.
#> → Run `duckplyr::fallback_sitrep()` to review the current settings.
#> ✔ Overwriting dplyr methods with duckplyr methods.
#> ℹ Turn off with `duckplyr::methods_restore()`.

mtcars |> 
  duckplyr::as_duckplyr_tibble() |> 
  summarise(wt = sum(wt, na.rm = TRUE))
#> The duckplyr package is configured to fall back to dplyr when it encounters an
#> incompatibility. Fallback events can be collected and uploaded for analysis to
#> guide future development. By default, no data will be collected or uploaded.
#> ℹ A fallback situation just occurred. The following information would have been
#>   recorded:
#>   {"version":"0.4.1","message":"Can't translate named argument `sum(na.rm =
#>   )`.","name":"summarise","x":{"...1":"numeric","...2":"numeric","...3":"numeric","...4":"numeric","...5":"numeric","...6":"numeric","...7":"numeric","...8":"numeric","...9":"numeric","...10":"numeric","...11":"numeric"},"args":{"dots":{"...6":"sum(...6,
#>   na.rm = TRUE)"}}}
#> → Run `duckplyr::fallback_sitrep()` to review the current settings.
#> → Run `Sys.setenv(DUCKPLYR_FALLBACK_COLLECT = 1)` to enable fallback logging,
#>   and `Sys.setenv(DUCKPLYR_FALLBACK_VERBOSE = TRUE)` in addition to enable
#>   printing of fallback situations to the console.
#> → Run `duckplyr::fallback_review()` to review the available reports, and
#>   `duckplyr::fallback_upload()` to upload them.
#> ℹ See `?duckplyr::fallback()` for details.
#> ℹ This message will be displayed once every eight hours.
#> # A tibble: 1 × 1
#>      wt
#>   <dbl>
#> 1  103.

Created on 2024-07-25 with reprex v2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants