Doctests for DecimalArray.#414
Conversation
|
cc/ @alamb |
There was a problem hiding this comment.
@alippai has an improvement for string formatting decimal values in #406
If he adds the method to DecimalArray in #406 (comment) it would be neat to also add it to the doc test.
There was a problem hiding this comment.
You'll be able to add assert_eq!("8887.000000", decimal_array.value_as_string(0)); when I finish the PR. Also I'd keep the assert_eq!(8_887_000_000, decimal_array.value(0)); example (to show the values are i128 values)
There was a problem hiding this comment.
@novemberkilo now it's merged, thanks for your patience
There was a problem hiding this comment.
I think using the DecimalBuilder to construct a DecimalArray may make for a better example:
For example, here: https://github.com/apache/arrow-rs/blob/master/arrow/src/array/builder.rs#L2856
Codecov Report
@@ Coverage Diff @@
## master #414 +/- ##
==========================================
- Coverage 82.64% 82.64% -0.01%
==========================================
Files 164 164
Lines 45508 45508
==========================================
- Hits 37609 37608 -1
- Misses 7899 7900 +1
Continue to review full report at Codecov.
|
alamb
left a comment
There was a problem hiding this comment.
Looks great -- thank you @novemberkilo
| /// | ||
| /// assert_eq!(&DataType::Decimal(23, 6), decimal_array.data_type()); | ||
| /// assert_eq!(8_887_000_000, decimal_array.value(0)); | ||
| /// assert_eq!("8887.000000", decimal_array.value_as_string(0)); |
Which issue does this PR close?
re #301
What changes are included in this PR?
Doctests only
Are there any user-facing changes?
No