Uh oh!
There was an error while loading. Please reload this page.
GH-46791: [C++] Add Status::OrElse, IntoStatus<T> and ToStatus - #46792
Conversation
pitrou
commented
Jun 12, 2025
@zanmato1984@bkietz@paleolimbot What do you think? |
pitrou
commented
Jun 12, 2025
Ah, clang is being picky. |
1c2266a to
e2cd325Compare
paleolimbot
left a comment
There was a problem hiding this comment.
These changes seems reasonable to me! The behaviour seems to line up exactly with Rust's .or_else() and I agree the macro was difficult to understand. The general maintenance around status handling is also great!
Uh oh!
There was an error while loading. Please reload this page.
pitrou
commented
Jun 12, 2025
You can guess it's intended :) |
zanmato1984
left a comment
There was a problem hiding this comment.
This looks nice! A few nits.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bkietz
left a comment
There was a problem hiding this comment.
LGTM, just some nits and an idea for an alternate approach
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Status::OrElseStatus::OrElse, IntoStatus<T> and ToStatuspitrou
commented
Jun 26, 2025
@github-actions crossbow submit -g cpp |
This comment was marked as outdated.
This comment was marked as outdated.
pitrou
commented
Jun 26, 2025
@github-actions crossbow submit -g cpp |
Revision: 65723c8 Submitted crossbow builds: ursacomputing/crossbow @ actions-dcfad22df7 |
pitrou
commented
Jun 26, 2025
@zanmato1984@paleolimbot@bkietz I've tried to address all your comments and suggestions, can you take a look again? |
paleolimbot
left a comment
There was a problem hiding this comment.
This is a nice improvement on the ergonomics of working with the Status! I took a look through for anything out of place although some of the C++ metaprogramming is over my head here 🙂
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 0140089. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
Rationale for this change
In #46711 (comment) it was mentioned that the macro
RETURN_NOT_OK_ELSEis confusing and can easily be misunderstood. We would like a better way to conditionally chain error-handling code if a Status does not indicate success.What changes are included in this PR?
IntoStatus<T>that can be implemented to provide conversions from other error-like typesToStatusfunction that calls the aforementioned type traitStatus::OrElsemethod that calls a functor on errorRETURN_NOT_OK_ELSEmacroAre these changes tested?
Yes.
Are there any user-facing changes?
No, the
RETURN_NOT_OK_ELSEwas not supposed to be called by third-party code as it's not prefixed withARROW_.