pierre-warnier opened a new pull request, #908:
URL: https://github.com/apache/arrow-rs-object-store/pull/908

   # Which issue does this PR close?
   
   Related to #292 (closed in 2025; reopened in [this 
comment](https://github.com/apache/arrow-rs-object-store/issues/292#issuecomment-6948096835)).
 Happy to file a new issue if you prefer.
   
   # Rationale for this change
   
   `humantime` is flagged unmaintained again by 
[RUSTSEC-2026-0542](https://rustsec.org/advisories/RUSTSEC-2026-0542.html) (no 
patched version), following chronotope/chrono#1768. `object_store` only uses it 
for the duration config values (`timeout`, `connect_timeout`, 
`pool_idle_timeout`, ...), and `jiff` 1.0 is now released with the same MSRV 
(1.85). See the discussion in #292.
   
   # What changes are included in this PR?
   
   - `src/config.rs`: parse durations with `jiff::fmt::friendly::SpanParser` 
and format them with `SpanPrinter`.
     - Calendar units (days and above) are parsed into a `Span` and converted 
with the lengths `humantime` used: day = 24h, week = 7 days, month = 30.44 
days, year = 365.25 days.
     - A bare `0` and leading/trailing whitespace are still accepted.
   - `Cargo.toml`: drop `humantime`; add `jiff` (`default-features = false`, 
`std`), enabled only by `cloud-base`, the only feature that compiles the 
`config` module. `fs`-only builds no longer pull a duration crate.
   - Tests: expected values for the existing formats were taken from 
`humantime` 2.4 output for the same inputs, plus invalid inputs and a 
format/parse round-trip.
   
   # Are there any user-facing changes?
   
   No public API change. Every value `get_config_value` returns still parses 
back to the same `Duration`.
   
   Differences I found when comparing both parsers over a set of inputs:
   
   | Input | humantime | this PR |
   |---|---|---|
   | `1M` (uppercase month) | 30.44 days | error (`1month` / `1mo` still work) |
   | repeated or out-of-order units (`1h 1h`, `1m 1h`) | summed | error |
   | fractional calendar units (`1.5d`, `1.5w`) | accepted | error (`1.5h` 
still works) |
   | more than 19998 years | accepted | error |
   | `1h, 30m` | error | accepted |
   | `get_config_value` for durations of a day or more | `1day 1h 1m 1s` | `25h 
1m 1s` |
   | `get_config_value` for microseconds | `3us` | `3µs` |
   
   The first rows reject only odd inputs that seem unlikely for timeouts; I'm 
happy to handle any of them if you'd rather keep them.
   
   Checked locally: `cargo fmt --check`, the clippy feature matrix from 
`ci.yml` with `-D warnings`, `cargo test --features=aws,azure,gcp,http`, `cargo 
doc --all-features`, and `cargo +1.85.0 check --all-targets --all-features`.
   
   AI disclosure (per the Arrow guidance on AI-generated code): this change was 
drafted with an AI assistant (Claude). I reviewed it and compared the old and 
new parsers on the inputs above.
   
   https://claude.ai/code/session_012jDuccR6cpFC88v8mL6SdB
   


-- 
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]

Reply via email to