dragosmg opened a new pull request, #13163:
URL: https://github.com/apache/arrow/pull/13163

   The `ym()`, `my()` and `yq()` bindings will make the following possible (and 
identical):
   
   ``` r
   library(arrow, warn.conflicts = FALSE)
   library(dplyr, warn.conflicts = FALSE)
   library(lubridate, warn.conflicts = FALSE)
   
   test_df <- tibble::tibble(
     ym_string = c("2022-05", "2022/02", "22.03", NA)
   )
   
   test_df %>% 
     mutate(ym_date = ym(ym_string))
   #> # A tibble: 4 × 2
   #>   ym_string ym_date   
   #>   <chr>     <date>    
   #> 1 2022-05   2022-05-01
   #> 2 2022/02   2022-02-01
   #> 3 22.03     2022-03-01
   #> 4 <NA>      NA
   
   test_df %>% 
     arrow_table() %>% 
     mutate(ym_date = ym(ym_string)) %>% 
     collect()
   #> # A tibble: 4 × 2
   #>   ym_string ym_date   
   #>   <chr>     <date>    
   #> 1 2022-05   2022-05-01
   #> 2 2022/02   2022-02-01
   #> 3 22.03     2022-03-01
   #> 4 <NA>      NA
   ```
   
   <sup>Created on 2022-05-16 by the [reprex 
package](https://reprex.tidyverse.org) (v2.0.1)</sup> 
   
   I've implementing this with the following steps:
   * add `"-01"` to the end of the strings we're trying to parse, and then
   * use one the supported `orders` (`"ymd"` or `"myd"`)  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to