diff --git a/datafusion/core/src/datasource/mod.rs b/datafusion/core/src/datasource/mod.rs index 32b3b0799dd85..c0cb9b5fa0fe6 100644 --- a/datafusion/core/src/datasource/mod.rs +++ b/datafusion/core/src/datasource/mod.rs @@ -76,6 +76,7 @@ mod tests { use datafusion_physical_plan::collect; use std::{fs, sync::Arc}; use tempfile::TempDir; + use url::Url; #[tokio::test] async fn can_override_physical_expr_adapter() { @@ -103,7 +104,8 @@ mod tests { writer.write(&rec_batch).unwrap(); writer.close().unwrap(); - let location = Path::parse(path.to_str().unwrap()).unwrap(); + let url = Url::from_file_path(path.canonicalize().unwrap()).unwrap(); + let location = Path::from_url_path(url.path()).unwrap(); let metadata = fs::metadata(path.as_path()).expect("Local file metadata"); let meta = ObjectMeta { location,