Skip to content

Commit 973c058

Browse files
committed
refactor: Simplify iterator usage and improve test assertions in shuffle storage
1 parent 3b89e69 commit 973c058

2 files changed

Lines changed: 6 additions & 17 deletions

File tree

ballista/core/src/execution_plans/shuffle_writer.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,7 @@ impl ShuffleWriterExec {
646646

647647
let mut part_locs = Vec::new();
648648

649-
for (output_partition, entry) in
650-
partition_batches.into_iter().enumerate()
649+
for (output_partition, entry) in partition_batches.into_iter().enumerate()
651650
{
652651
if let Some((batches, _num_batches, _num_rows)) = entry {
653652
let (path, stats) = storage

ballista/core/src/shuffle_storage.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -871,14 +871,9 @@ mod tests {
871871
assert_eq!(config.storage_type, ShuffleStorageType::Azure);
872872
assert_eq!(
873873
config.base_url,
874-
Some(
875-
"abfs://mycontainer@myaccount.dfs.core.windows.net/shuffle".to_string()
876-
)
877-
);
878-
assert_eq!(
879-
config.azure_config.account,
880-
Some("myaccount".to_string())
874+
Some("abfs://mycontainer@myaccount.dfs.core.windows.net/shuffle".to_string())
881875
);
876+
assert_eq!(config.azure_config.account, Some("myaccount".to_string()));
882877
assert_eq!(
883878
config.azure_config.container,
884879
Some("mycontainer".to_string())
@@ -893,18 +888,13 @@ mod tests {
893888
)
894889
.unwrap();
895890
assert_eq!(config.storage_type, ShuffleStorageType::Azure);
896-
assert_eq!(
897-
config.azure_config.account,
898-
Some("myaccount".to_string())
899-
);
891+
assert_eq!(config.azure_config.account, Some("myaccount".to_string()));
900892
}
901893

902894
#[test]
903895
fn test_from_type_and_url_s3_invalid_url() {
904-
let result = ShuffleStorageConfig::from_type_and_url(
905-
ShuffleStorageType::S3,
906-
"not-a-url",
907-
);
896+
let result =
897+
ShuffleStorageConfig::from_type_and_url(ShuffleStorageType::S3, "not-a-url");
908898
assert!(result.is_err());
909899
}
910900
}

0 commit comments

Comments
 (0)