Skip to content

[C++] Support parsing of "2020-01" into 2020-01-01 #31979

@asfimport

Description

@asfimport

Originated as part of the review for the ARROW-16407 PR.

Currently we get a surprising output when parsing of %Y-%m strings such as "2020-01" - see reprex below.

library(arrow, warn.conflicts = FALSE)

call_function(
  "strptime",
  Array$create("2020-01"),
  options = list(
    format = "%Y-%m",
    unit = 0L
  )
)
#> Array
#> <timestamp[s]>
#> [
#>   2019-12-31 00:00:00
#> ]

I'm not sure if this would be useful somewhere else, but we could definitely use this to remove some workarounds in the R bindings.

Reporter: Dragoș Moldovan-Grünfeld / @dragosmg
Watchers: Rok Mihevc / @rok

Related issues:

Note: This issue was originally created as ARROW-16627. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions