Skip to content

Conversation

@rok
Copy link
Member

@rok rok commented Mar 28, 2022

As reported by @dragosmg the following:

StrptimeOptions options("%m/%d/%Y", TimeUnit::MICRO, /*error_is_null=*/true);
std::string input2 = R"(["5-1-2020", "12/13/1900"])";
std::string output2 = R"([null, "1900-12-13"])";
Strptime(input2, options)

Would cause:

Expected:
  [
    null,
    1900-12-13 00:00:00.000000
  ]
Actual:
  [
    null,
    1970-01-01 00:00:00.000000
  ]

This was due to out_data pointer not updating on failed parsing.

This change fixes the issue and adds a test.

@rok
Copy link
Member Author

rok commented Mar 28, 2022

@lidavidm I'm a bit embarrassed by this one :)

Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, d'oh, we both missed this one. Thanks for fixing this.

@github-actions
Copy link

@lidavidm lidavidm changed the title ARROW-15665: [C++] Add error handling option to StrptimeOptions - follow up ARROW-15665: [C++] Fix error_is_null in strptime with null inputs Mar 28, 2022
@lidavidm lidavidm changed the title ARROW-15665: [C++] Fix error_is_null in strptime with null inputs ARROW-15665: [C++] Fix error_is_null in strptime with invalid inputs Mar 28, 2022
@lidavidm lidavidm closed this in 6a0770c Mar 28, 2022
@ursabot
Copy link

ursabot commented Mar 28, 2022

Benchmark runs are scheduled for baseline = f4dfd6c and contender = 6a0770c. 6a0770c is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.38% ⬆️0.13%] test-mac-arm
[Finished ⬇️0.36% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️1.02% ⬆️0.3%] ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants