[ 
https://issues.apache.org/jira/browse/ARROW-16443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17531143#comment-17531143
 ] 

Dragoș Moldovan-Grünfeld commented on ARROW-16443:
--------------------------------------------------

The {{test-dplyr-funcs-datetime.R}} file where the unit test failing on the CI 
mentioned in the ticket description forces {{LC_TIME}} to be {{"C"}}. 
Snippet:
{code:r}
# base::strptime() defaults to local timezone
# but arrow's strptime defaults to UTC.
# So that tests are consistent, set the local timezone to UTC
# TODO: consider reevaluating this workaround after ARROW-12980
withr::local_timezone("UTC")

if (tolower(Sys.info()[["sysname"]]) == "windows") {
  withr::local_locale(LC_TIME = "C")
}
{code}

> [C++][R] strptime fails to parse with %b or %B on Windows
> ---------------------------------------------------------
>
>                 Key: ARROW-16443
>                 URL: https://issues.apache.org/jira/browse/ARROW-16443
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++, R
>            Reporter: Dragoș Moldovan-Grünfeld
>            Priority: Major
>
> The following works on macOS
> {code:r}
> library(arrow, warn.conflicts = FALSE)
> a <- Array$create("2021 September 13")
> call_function("strptime", a, options = list(format = "%Y %B %d", unit = 0L))
> #> Array
> #> <timestamp[s]>
> #> [
> #>   2021-09-13 00:00:00
> #> ]
> {code}
> but fails on Windows, with:
> {code:r}
> ``` r
> #> Error: Invalid: Failed to parse string: '2021 September 13' as a scalar of 
> type timestamp[s]
> {code}
> I came across this while implementing the {{parse_date_time()}} bindings, 
> when the Windows CI jobs were failing to parse date with the months expressed 
> either as name or short name. 
> https://github.com/apache/arrow/runs/6270529412?check_suite_focus=true#step:20:20856
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to