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

   This PR will allow the use of namespacing with bindings:
   ``` r
   library(arrow, warn.conflicts = FALSE)
   library(dplyr, warn.conflicts = FALSE)
   library(lubridate, warn.conflicts = FALSE)
   
   test_df <- tibble(
     date = as.Date(c("2022-03-22", "2021-07-30", NA))
   )
   
   test_df %>%
     mutate(ddate = lubridate::as_datetime(date)) %>%
     collect()
   #> # A tibble: 3 × 2
   #>   date       ddate              
   #>   <date>     <dttm>             
   #> 1 2022-03-22 2022-03-22 00:00:00
   #> 2 2021-07-30 2021-07-30 00:00:00
   #> 3 NA         NA
   
   test_df %>%
     arrow_table() %>% 
     mutate(ddate = lubridate::as_datetime(date)) %>%
     collect()
   #> # A tibble: 3 × 2
   #>   date       ddate              
   #>   <date>     <dttm>             
   #> 1 2022-03-22 2022-03-22 00:00:00
   #> 2 2021-07-30 2021-07-30 00:00:00
   #> 3 NA         NA
   ```
   
   <sup>Created on 2022-05-14 by the [reprex 
package](https://reprex.tidyverse.org) (v2.0.1)</sup> 
   
   The approach:
   * change the naming convention for bindings, from `"as_datetime"` to 
`"lubridate_as_datetime"`, for 2 reasons:
     * it gives us an indication of the package / namespace where linking to
     * it avoids the use of the double-colon (`::`) operator (easier dealing 
with strings only)
   * we register each binding both with its _short_ name (`"as_datetime"`) and 
its _full_ name (`"lubridate_as_datetime"`)
   * we change the expressions supplied by the user by replacing the double 
colon (`::`) with an underscore (`_`)


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