Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 4.3k
ARROW-14819: [R] Binding for lubridate::qday#13440
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
3b90e25e0676b005c8a24b018e3c3247ce837ebd87ef84a7aFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -574,6 +574,26 @@ test_that("extract yday from timestamp", { | ||
| ) | ||
| }) | ||
| test_that("extract qday from timestamp", { | ||
| test_df <- tibble::tibble( | ||
| time = as.POSIXct(seq(as.Date("1999-12-31", tz = "UTC"), as.Date("2001-01-01", tz = "UTC"), by = "day")) | ||
| ) | ||
| compare_dplyr_binding( | ||
| .input %>% | ||
| transmute(x = qday(time)) %>% | ||
| collect(), | ||
| test_df | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rather than tibble::tibble(date= seq(as.Date("2000-01-01"), as.Date("2000-12-31"), by="day"))
#> # A tibble: 366 × 1#> date #> <date> #> 1 2000-01-01#> 2 2000-01-02#> 3 2000-01-03#> 4 2000-01-04#> 5 2000-01-05#> 6 2000-01-06#> 7 2000-01-07#> 8 2000-01-08#> 9 2000-01-09#> 10 2000-01-10#> # … with 356 more rowstibble::tibble(datetime= seq(as.POSIXct("2000-01-01 00:00:00"), as.POSIXct("2000-12-31 23:00:00"), by="day"))
#> # A tibble: 366 × 1#> datetime #> <dttm> #> 1 2000-01-01 00:00:00#> 2 2000-01-02 00:00:00#> 3 2000-01-03 00:00:00#> 4 2000-01-04 00:00:00#> 5 2000-01-05 00:00:00#> 6 2000-01-06 00:00:00#> 7 2000-01-07 00:00:00#> 8 2000-01-08 00:00:00#> 9 2000-01-09 00:00:00#> 10 2000-01-10 00:00:00#> # … with 356 more rowsMemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I love the idea of more complete tests! I would actually propose a development-time test suite (it seems overkill for CI) that tests every moment over the past century. The test you're proposing however hits this bug where rounding kernels interpret 32 bit arrays as 64 bit ones (ARROW-16142) so I suppose we really need to fix this now. Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could try that and see how long it takes...it might only be a few ms and then I'd say keep it in the regular test suite. We do have a mechanism for running extra tests but right now it's limited to the large memory tests (via the env var ARROW_LARGE_MEMORY_TESTS). Given that a single real-world poke at this exposed an error, I'd say at least a year is a must in our normal test suite. MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, why not. I'll give it a try. MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, ARROW-16142 was resolved so this is now ready. | ||
| ) | ||
| compare_dplyr_binding( | ||
| .input %>% | ||
| transmute(x = qday(as.POSIXct("2022-06-29 12:35"))) %>% | ||
| collect(), | ||
| test_df | ||
| ) | ||
| }) | ||
rok marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| test_that("extract hour from timestamp", { | ||
| compare_dplyr_binding( | ||
| .input %>% | ||
| @@ -790,6 +810,26 @@ test_that("extract yday from date", { | ||
| ) | ||
| }) | ||
| test_that("extract qday from date", { | ||
| test_df <- tibble::tibble( | ||
| date = seq(as.Date("1999-12-31"), as.Date("2001-01-01"), by = "day") | ||
| ) | ||
| compare_dplyr_binding( | ||
| .input %>% | ||
| mutate(x = qday(date)) %>% | ||
| collect(), | ||
| test_df | ||
rok marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| ) | ||
| compare_dplyr_binding( | ||
| .input %>% | ||
| mutate(y = qday(as.Date("2022-06-29"))) %>% | ||
| collect(), | ||
| test_df | ||
| ) | ||
| }) | ||
rok marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| test_that("leap_year mirror lubridate", { | ||
| compare_dplyr_binding( | ||
| .input %>% | ||
Uh oh!
There was an error while loading. Please reload this page.