Skip to content

Commit dd988f6

Browse files
authored
Fix test that's broken on Windows due to naive path handling (#20692)
## Which issue does this PR close? Fixed a test that was failing on Windows due to naive path handling.
1 parent a95da70 commit dd988f6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • datafusion/core/src/datasource

datafusion/core/src/datasource/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ mod tests {
7676
use datafusion_physical_plan::collect;
7777
use std::{fs, sync::Arc};
7878
use tempfile::TempDir;
79+
use url::Url;
7980

8081
#[tokio::test]
8182
async fn can_override_physical_expr_adapter() {
@@ -103,7 +104,8 @@ mod tests {
103104
writer.write(&rec_batch).unwrap();
104105
writer.close().unwrap();
105106

106-
let location = Path::parse(path.to_str().unwrap()).unwrap();
107+
let url = Url::from_file_path(path.canonicalize().unwrap()).unwrap();
108+
let location = Path::from_url_path(url.path()).unwrap();
107109
let metadata = fs::metadata(path.as_path()).expect("Local file metadata");
108110
let meta = ObjectMeta {
109111
location,

0 commit comments

Comments
 (0)