dragosmg opened a new pull request #12402:
URL: https://github.com/apache/arrow/pull/12402
This PR aligns arrow's binding to `strptime()` to `base::strptime()` when
the value passed to the `format` argument does not match the data. Currently
arrow errors, when it should return `NA`.
``` r
suppressMessages(library(lubridate))
suppressMessages(library(arrow))
suppressMessages(library(dplyr))
df <- tibble(x = "2022-02-11")
df %>%
mutate(z = strptime(x, format = "%Y-%m %d"))
#> # A tibble: 1 × 2
#> x z
#> <chr> <dttm>
#> 1 2022-02-11 NA
df %>%
record_batch() %>%
mutate(z = strptime(x, format = "%Y-%m %d")) %>%
collect()
#> Error: Invalid: Failed to parse string: '2022-02-11' as a scalar of type
timestamp[ms]
```
<sup>Created on 2022-02-11 by the [reprex
package](https://reprex.tidyverse.org) (v2.0.1)</sup>
--
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]