Skip to content

Commit

Permalink
format rust code
Browse files Browse the repository at this point in the history
Signed-off-by: anmol.singh <[email protected]>
  • Loading branch information
anmolsingh20 committed Sep 8, 2024
1 parent 3144040 commit e477f18
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/daft-scan/src/glob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,19 @@ impl ScanOperator for GlobScanOperator {
self.glob_paths.join(", ")
} else {
let first_three: Vec<String> = self.glob_paths.iter().take(3).cloned().collect();
let last_three: Vec<String> = self.glob_paths.iter().skip(self.glob_paths.len() - 3).cloned().collect();
let last_three: Vec<String> = self
.glob_paths
.iter()
.skip(self.glob_paths.len() - 3)
.cloned()
.collect();

let mut result = first_three.join(", ");
result.push_str(", ...");
result.push_str(", ");
result.push_str(&last_three.join(", "));

result

};

let mut lines = vec![
Expand Down
9 changes: 5 additions & 4 deletions src/daft-scan/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,10 @@ mod test {
use itertools::Itertools;

use crate::{
file_format::{FileFormatConfig, ParquetSourceConfig}, glob::GlobScanOperator, storage_config::{NativeStorageConfig, StorageConfig}, DataSource, Pushdowns, ScanOperator, ScanTask
file_format::{FileFormatConfig, ParquetSourceConfig},
glob::GlobScanOperator,
storage_config::{NativeStorageConfig, StorageConfig},
DataSource, Pushdowns, ScanOperator, ScanTask,
};

fn make_scan_task(num_sources: usize) -> ScanTask {
Expand Down Expand Up @@ -1010,11 +1013,10 @@ mod test {
});

let mut sources: Vec<String> = Vec::new();

for _ in 0..num_sources {
sources.push(format!("../../tests/assets/parquet-data/mvp.parquet"));
// sources.push(format!("File {}", i + 1));

}

let glob_paths: Vec<&str> = sources.iter().map(|s| s.as_str()).collect();
Expand All @@ -1031,7 +1033,6 @@ mod test {
.unwrap();

glob_scan_operator

}

#[test]
Expand Down

0 comments on commit e477f18

Please sign in to comment.