-
Notifications
You must be signed in to change notification settings - Fork 816
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
Add Decimal to CsvWriter and improve debug display #406
Conversation
Codecov Report
@@ Coverage Diff @@
## master #406 +/- ##
=======================================
Coverage 82.65% 82.65%
=======================================
Files 164 164
Lines 45458 45478 +20
=======================================
+ Hits 37573 37592 +19
- Misses 7885 7886 +1
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.
I think the code is looking good @alippai -- thank you. I had some suggestions / questions on the API -- @nevi-me / @Dandandan do you have any thoughts on the API?
assert_eq!( | ||
"DecimalArray<23, 6>\n[\n 8887000000,\n -8887000000,\n]", | ||
"DecimalArray<23, 6>\n[\n 8887.000000,\n -8887.000000,\n null,\n]", |
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.
this looks like a significant improvement to me 👍
05b542f
to
c858052
Compare
c858052
to
83f5f6b
Compare
@alamb Created What I couldn't find is the usage of |
Thanks @nevi-me |
Thanks @alippai -- this looks great 👍 |
* Add Decimal to CsvWriter and improve debug display * Measure CSV writer instead of file and data creation * Re-use decimal formatting
* Add Decimal to CsvWriter and improve debug display * Measure CSV writer instead of file and data creation * Re-use decimal formatting
Which issue does this PR close?
Closes #405.
Rationale for this change
A simple CSV serializer for Decimals and matching debug format improvement.
What changes are included in this PR?
Decimal -> string conversion.
Are there any user-facing changes?
The debug display of DecimalArray(precision:10, scale:2) is changed from:
to
Two things to consider for any reviewer:
try_into()
andas i32
and other cast. I'm new to Rust and I don't know the exact implications of my introduced changes.1.0
instead of1
. This was a subjective decision, I don't have strong feelings about it. Padding was/is missing as well.