-
Couldn't load subscription status.
- Fork 3.9k
ARROW-4377: [Rust] Implement std::fmt::Debug for PrimitiveArrays #3663
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
|
Thanks @ntrinquier, can you change the title to "ARROW-4377: [Rust] Implement std::fmt::Debug for PrimitiveArrays" please. I'll take a look when I get a chance. |
|
Also, CI is failing due to formatting issues. We use nightly compiler but stable rust fmt so you can run |
Codecov Report
@@ Coverage Diff @@
## master #3663 +/- ##
==========================================
- Coverage 87.84% 87.78% -0.06%
==========================================
Files 689 689
Lines 84014 84014
Branches 1081 1081
==========================================
- Hits 73798 73752 -46
- Misses 10103 10151 +48
+ Partials 113 111 -2
Continue to review full report at Codecov.
|
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 for taking this on Nicolas, please see my inline comment.
| } | ||
|
|
||
| #[test] | ||
| fn test_boolean_fmt_debug() { |
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.
May you please add tests for null values, I don't think you handle them because getting a null value returns invalid data.
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.
Will do! Thanks
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.
Looking good so far. I'd like to see those unwraps removed in favor of returning an error result though (I'm guilty of using unwrap too, but I think it won't be hard to make the change here).
rust/arrow/src/array.rs
Outdated
| T::get_data_type(), | ||
| self.len() | ||
| ) | ||
| .unwrap(); |
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.
It would be better to return fmt::Result(Error) rather than call unwrap here
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.
@ntrinquier what do you think about displaying the array values vertically?
This would be more consistent with C++/Python and make it easier to debug larger arrays.
Also, if we want to debug nested arrays in the future we can use the vertical indentation to help display the nesting levels.
|
@paddyhoran It leaves more unused space but I guess it is better to be consistent (plus as you said, with nesting it will actually be much better if displayed vertically). |
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'm happy
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.
Yep, LGTM, thanks @ntrinquier
|
CI failure is unrelated, merging. Thanks @ntrinquier! |
No description provided.