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

Checks fail with duckplyr #720

Closed
krlmlr opened this issue Oct 28, 2024 · 3 comments
Closed

Checks fail with duckplyr #720

krlmlr opened this issue Oct 28, 2024 · 3 comments

Comments

@krlmlr
Copy link

krlmlr commented Oct 28, 2024

The duckplyr package is aimed to be a drop-in replacement for dplyr, with full behavior compatibility. To assert that, I'm running checks with a rigged version of dplyr. This package fails its checks in this scenario.

Details: https://github.com/krlmlr/dplyr/blob/f-revdep-duckplyr/revdep/problems.md .

Learn more about duckplyr: https://duckplyr.tidyverse.org/ .

From the error message, I can't tell immediately what the cause of the failure is. I'd appreciate your help: can you please help digest a reproducible example that shows how duckplyr is behaving differently from dplyr in your use case?

The modified dplyr version can be installed with any of:

pak::pak("krlmlr/dplyr@f-revdep-duckplyr")
# remotes::install_github("krlmlr/dplyr@f-revdep-duckplyr")
# devtools::install_github("krlmlr/dplyr@f-revdep-duckplyr")

Thanks a lot for your help! Please let me know if you have any questions.

Tracker: tidyverse/duckplyr#297.

@catalamarti
Copy link
Collaborator

hi @krlmlr I've reduced the error to this simple reprex:

your branch:

dplyr::tibble(
  x = c(2000L, NA_integer_),
  y = c(1000L, 1000L)
) |>
  dplyr::mutate(new_col = dplyr::if_else(
    .data$x <= .data$y,
    .data$x,
    .data$y
  ))
#> # A tibble: 2 × 3
#>       x     y new_col
#>   <int> <int>   <int>
#> 1  2000  1000    1000
#> 2    NA  1000    1000

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

dplyr current behavior:

dplyr::tibble(
  x = c(2000L, NA_integer_),
  y = c(1000L, 1000L)
) |>
  dplyr::mutate(new_col = dplyr::if_else(
    .data$x <= .data$y,
    .data$x,
    .data$y
  ))
#> # A tibble: 2 × 3
#>       x     y new_col
#>   <int> <int>   <int>
#> 1  2000  1000    1000
#> 2    NA  1000      NA

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

@krlmlr
Copy link
Author

krlmlr commented Oct 29, 2024

Brilliant, that's exactly the kind of reprex I'm looking for. Thank you!

@krlmlr
Copy link
Author

krlmlr commented Oct 30, 2024

Will be fixed soon in duckplyr, I no longer see issues with PatientProfiles in the modified dplyr package. Thanks again!

@krlmlr krlmlr closed this as completed Oct 30, 2024
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