alamb commented on code in PR #908:
URL:
https://github.com/apache/arrow-rs-object-store/pull/908#discussion_r4804162881
##########
src/config.rs:
##########
@@ -123,7 +171,7 @@ impl Parse for HeaderValue {
pub(crate) fn fmt_duration(duration: &ConfigValue<Duration>) -> String {
match duration {
- ConfigValue::Parsed(v) => format_duration(*v).to_string(),
+ ConfigValue::Parsed(v) =>
SpanPrinter::new().unsigned_duration_to_string(v),
Review Comment:
it is kind if strange to use jiff just for this, while we have our own
custom duration parser. I am going to try and remove the jiff dependency
entirely by basically inlining the humantime implementation.
##########
src/config.rs:
##########
@@ -140,4 +188,69 @@ mod tests {
assert_eq!(Duration::parse("60 s").unwrap(), duration);
assert_eq!(Duration::parse("60s").unwrap(), duration)
}
+
+ #[test]
+ fn test_parse_duration_formats() {
+ // Expected values match what `humantime` 2.x returned for the same
inputs
+ let cases = [
Review Comment:
These are good tests -- I extended and extracted them out here:
-
https://github.com/apache/arrow-rs-object-store/pull/936#issuecomment-7420733914
I'll merge that and then merge / resolve conflicts with this PR so we can
demonstrate the behavior doesn't chagne
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]