MCPcopy Create free account
hub / github.com/apache/datafusion / assert_path_in_dirs

Function assert_path_in_dirs

datafusion/execution/src/disk_manager.rs:560–573  ·  view source on GitHub ↗

Asserts that `file_path` is found anywhere in any of `dir` directories

(
        file_path: &'a Path,
        dirs: impl Iterator<Item = &'a Path>,
    )

Source from the content-addressed store, hash-verified

558
559 /// Asserts that `file_path` is found anywhere in any of `dir` directories
560 fn assert_path_in_dirs<'a>(
561 file_path: &'a Path,
562 dirs: impl Iterator<Item = &'a Path>,
563 ) {
564 let dirs: Vec<&Path> = dirs.collect();
565
566 let found = dirs.iter().any(|dir_path| {
567 file_path
568 .ancestors()
569 .any(|candidate_path| *dir_path == candidate_path)
570 });
571
572 assert!(found, "Can't find {file_path:?} in dirs: {dirs:?}");
573 }
574
575 #[test]
576 fn test_temp_file_still_alive_after_disk_manager_dropped() -> Result<()> {

Callers 2

lazy_temp_dir_creationFunction · 0.85
file_in_right_dirFunction · 0.85

Calls 3

collectMethod · 0.80
anyMethod · 0.45
iterMethod · 0.45

Tested by 2

lazy_temp_dir_creationFunction · 0.68
file_in_right_dirFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…