Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent the potential for a panic in the string_to_timestamp coercions #205

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

rtyler
Copy link
Member

@rtyler rtyler commented Dec 10, 2024

The original code was turning nanos into micros anyways, so we can use the more safe timestamp_micros() code.

For timestamp_nanos_opt() it can return None if the dates that cannot be represented as nanoseconds between 1677-09-21T00:12:43.145224192 and 2262-04-11T23:47:16.854775807.

@rtyler rtyler force-pushed the less-panic-in-coersions branch from d353ef5 to 15e7578 Compare December 11, 2024 14:26
The original code was turning nanos into micros anyways, so we can use
the more safe timestamp_micros() code.

For timestamp_nanos_opt() it can return None if the dates that cannot be
represented as nanoseconds between 1677-09-21T00:12:43.145224192 and
2262-04-11T23:47:16.854775807.

Signed-off-by: R. Tyler Croy <rtyler@brokenco.de>
@rtyler rtyler force-pushed the less-panic-in-coersions branch from 15e7578 to 4cadc33 Compare December 11, 2024 14:38
@rtyler rtyler requested a review from mightyshazam December 11, 2024 14:46
@rtyler rtyler marked this pull request as ready for review December 11, 2024 14:46
@rtyler rtyler enabled auto-merge (rebase) December 11, 2024 14:47
@rtyler rtyler merged commit 9fe6546 into main Dec 11, 2024
3 checks passed
@rtyler rtyler deleted the less-panic-in-coersions branch December 11, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants