-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Review use of panic in datafusion-proto crate #3365
Conversation
# Conflicts: # datafusion/proto/build.rs
Codecov Report
@@ Coverage Diff @@
## master #3365 +/- ##
========================================
Coverage 85.51% 85.51%
========================================
Files 294 296 +2
Lines 54120 54300 +180
========================================
+ Hits 46279 46433 +154
- Misses 7841 7867 +26
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Looks like there is a CI error on this PR. |
@@ -224,10 +224,12 @@ impl From<&DataType> for protobuf::arrow_type::ArrowTypeEnum { | |||
fractional: *fractional as u64, | |||
}), | |||
DataType::Decimal256(_, _) => { | |||
unimplemented!("The Decimal256 data type is not yet supported") | |||
unimplemented!("Proto serialization error: The Decimal256 data type is not yet supported") |
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.
If we used impl TryFrom
instead of impl From
, we could return errors here. This could be done as a separate Pr.
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.
Created #3401
Thanks @comphead. This is looking good. I left some comments. |
@andygrove @alamb I dont get why |
I think the reason that https://github.com/apache/arrow-datafusion/runs/8218776681?check_suite_focus=true is failing is that there is some issue in code that is not normally run via In this case, the command that is failing is: cargo check --workspace --benches --features avro,jit,scheduler,json Does that fail locally for you? |
Thanks @alamb |
Sorry guys, I probably generated more commits than expected, the reason being is cargo check gives me not the same results as CI, even after cleaning the cache |
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.
LGTM. Thanks @comphead
@avantgardnerio I know you fixed a json proto build issue recently. Could you take a look at this PR to make sure you are happy with it? |
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 added a few minor nits, but overall I think this is a definite improvement - thank you for putting in this work!
@@ -32,7 +32,9 @@ fn main() -> Result<(), String> { | |||
fn build() -> Result<(), String> { | |||
use std::io::Write; | |||
|
|||
let out = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap()); | |||
let out = std::path::PathBuf::from( | |||
std::env::var("OUT_DIR").expect("Cannot find OUT_DIR environment vairable"), |
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.
expect
seems semi-reasonable in tests or build.rs
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.
Imho expect here gives more user friendly message than .unwrap
with very generic text
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.
expect is a definite improvement to unwrap
in my opinion too
Thanks @avantgardnerio for the review, please find the fixed PR |
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.
LGTM -- thanks @avantgardnerio and @comphead !
Benchmark runs are scheduled for baseline = 4258751 and contender = 1b40ffa. 1b40ffa is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #3318.
Rationale for this change
Refactor to get rid of explicit panics
What changes are included in this PR?
Are there any user-facing changes?