Commits


Dragoș Moldovan-Grünfeld authored and Jonathan Keane committed 1b77e6dfc15
ARROW-15701 [R] month() should allow integer inputs Once this PR is merge the {arrow} binding for `month()` will be able to accept integer inputs. This also impact the `semester()` which now will be able to extract semesters from integer inputs. ``` r library(lubridate) library(dplyr) library(arrow) df <- tibble( month_as_int = 1:12 ) df %>% mutate(m = month(month_as_int), s = semester(month_as_int)) #> # A tibble: 12 × 3 #> month_as_int m s #> <int> <int> <int> #> 1 1 1 1 #> 2 2 2 1 #> 3 3 3 1 #> 4 4 4 1 #> 5 5 5 1 #> 6 6 6 1 #> 7 7 7 2 #> 8 8 8 2 #> 9 9 9 2 #> 10 10 10 2 #> 11 11 11 2 #> 12 12 12 2 df %>% arrow_table() %>% mutate(m = month(month_as_int), s = semester(month_as_int)) %>% collect() #> # A tibble: 12 × 3 #> month_as_int m s #> <int> <int> <int> #> 1 1 1 1 #> 2 2 2 1 #> 3 3 3 1 #> 4 4 4 1 #> 5 5 5 1 #> 6 6 6 1 #> 7 7 7 2 #> 8 8 8 2 #> 9 9 9 2 #> 10 10 10 2 #> 11 11 11 2 #> 12 12 12 2 ``` <sup>Created on 2022-03-02 by the [reprex package](https://reprex.tidyverse.org) (v2.0.1)</sup> Closes #12482 from dragosmg/lubridate_month_int_input Lead-authored-by: Dragoș Moldovan-Grünfeld <dragos.mold@gmail.com> Co-authored-by: Jonathan Keane <jkeane@gmail.com> Signed-off-by: Jonathan Keane <jkeane@gmail.com>