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 #18

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

Checks fail with duckplyr #18

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.

@dschafer
Copy link
Owner

dschafer commented Nov 2, 2024

Here's a reduced example. With dplyr 1.1.4:

library(tibble)
library(lubridate)
library(dplyr)
s <- tibble::tibble(x = 1)
time <- 1 |> as.duration()
s <- s |> mutate(Time = time)
is(s$Time)
#> [1] "Duration" "Timespan" "numeric"  "vector"

Created on 2024-11-01 with reprex v2.1.1

With krlmlr/dplyr@f-revdep-duckplyr:

library(tibble)
library(lubridate)
library(dplyr)
s <- tibble::tibble(x = 1)
time <- 1 |> as.duration()
s <- s |> mutate(Time = time)
is(s$Time)
#> [1] "numeric" "vector"

Created on 2024-11-01 with reprex v2.1.1

@dschafer dschafer closed this as completed Nov 2, 2024
@dschafer
Copy link
Owner

dschafer commented Nov 2, 2024

@krlmlr closing this out since hopefully that reduced example is what you were looking for (specifically, it looks like when a column is created with a lubridate Duration, the class is handled differently between dplyr and duckplyr)

@krlmlr
Copy link
Author

krlmlr commented Nov 2, 2024

Thank you very much for your support, this is very helpful!

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