Skip to content

Commit

Permalink
chore: enable cloud flag, add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ion-elgreco committed Jan 14, 2025
1 parent d636e02 commit eb8fb9b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ arrow-ord = { version = "53" }
arrow-row = { version = "53" }
arrow-schema = { version = "53" }
arrow-select = { version = "53" }
object_store = { version = "0.11.2" }
object_store = { version = "0.11.2" , features = ["cloud"]}
parquet = { version = "53" }

# datafusion
Expand Down
27 changes: 27 additions & 0 deletions crates/core/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,10 @@ pub mod storage_constants {

#[cfg(test)]
mod tests {
use std::time::Duration;

use maplit::hashmap;

use super::*;

#[test]
Expand Down Expand Up @@ -643,4 +647,27 @@ mod tests {
format!("{limited}")
);
}

#[test]
fn test_retry_config_from_options() {
struct TestFactory {}
impl RetryConfigParse for TestFactory {}

let options = hashmap! {
"max_retries".to_string() => "100".to_string() ,
"retry_timeout".to_string() => "300s".to_string() ,
"backoff_config.init_backoff".to_string() => "20s".to_string() ,
"backoff_config.max_backoff".to_string() => "1h".to_string() ,
"backoff_config.base".to_string() => "50.0".to_string() ,
};
let retry_config = TestFactory {}
.parse_retry_config(&StorageOptions(options))
.unwrap();

assert_eq!(retry_config.max_retries, 100);
assert_eq!(retry_config.retry_timeout, Duration::from_secs(300));
assert_eq!(retry_config.backoff.init_backoff, Duration::from_secs(20));
assert_eq!(retry_config.backoff.max_backoff, Duration::from_secs(3600));
assert_eq!(retry_config.backoff.base, 50 as f64);
}
}

0 comments on commit eb8fb9b

Please sign in to comment.