-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add fallible versions of temporal functions that may panic #7737
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
Conversation
| /// Arithmetic trait for date arrays | ||
| /// | ||
| /// Note: these should be fallible (#4456) | ||
| trait DateOp: ArrowTemporalType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I felt that it was better to just break this trait than introduce all of the new methods. It should be pretty easy for users to update the trait implementation itself, and it's always possible for them to just .expect(...) in their code to at least acknowledge the fallibility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I double checked that this is not a public trait and thus this change is not a breaking API change
|
🤖 |
alamb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @adriangb -- this looks good to me -- I have kicked off some performance tests just to verify this doesn't change anything
I do think we should try and add some tests to this ideally showing that we can now catch overflows as errors rather than panics. Would you have time to do that?
| /// Arithmetic trait for date arrays | ||
| /// | ||
| /// Note: these should be fallible (#4456) | ||
| trait DateOp: ArrowTemporalType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I double checked that this is not a public trait and thus this change is not a breaking API change
|
Additional context is we hit this panic in DataFusion (and found a workaround) |
Yes I think I should have time in the next couple days! |
|
🤖: Benchmark completed Details
|
|
🤖 |
|
🤖: Benchmark completed Details
|
…panic due to overflows
3659a9e to
897fec6
Compare
|
@alamb I've added quite a bit of tests |
alamb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really nice to me -- thank you @adriangb
|
@alamb I don't have commit rights here, could you merge this if you think it's ready? thanks! |
Uh oh!
There was an error while loading. Please reload this page.