Skip to content

Commit be64e65

Browse files
author
Brent Gardner
committed
Revert path "fixes" that broke windows
1 parent 2761a7e commit be64e65

4 files changed

Lines changed: 6 additions & 13 deletions

File tree

datafusion/core/src/datasource/file_format/json.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,21 +231,17 @@ mod tests {
231231
projection: Option<Vec<usize>>,
232232
limit: Option<usize>,
233233
) -> Result<Arc<dyn ExecutionPlan>> {
234-
let store_root = env!("CARGO_MANIFEST_DIR");
235234
let filename = "tests/jsons/2.json";
236235
let format = JsonFormat::default();
237-
scan_format(&format, store_root, filename, projection, limit).await
236+
scan_format(&format, ".", filename, projection, limit).await
238237
}
239238

240239
#[tokio::test]
241240
async fn infer_schema_with_limit() {
242241
let store = Arc::new(LocalFileSystem::new()) as _;
242+
let filename = "tests/jsons/schema_infer_limit.json";
243243
let format = JsonFormat::default().with_schema_infer_max_rec(Some(3));
244244

245-
let store_root = std::path::Path::new(env!("CARGO_MANIFEST_DIR"));
246-
let filename = store_root.join("tests/jsons/schema_infer_limit.json");
247-
let filename = filename.to_str().expect("Unable to get path!");
248-
249245
let file_schema = format
250246
.infer_schema(&store, &[local_unpartitioned_file(filename)])
251247
.await

datafusion/core/src/physical_plan/file_format/json.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ mod tests {
257257
let store_url = ObjectStoreUrl::local_filesystem();
258258
let store = ctx.runtime_env().object_store(&store_url).unwrap();
259259

260-
let store_root = Path::new(env!("CARGO_MANIFEST_DIR"));
261-
let path = store_root.join(TEST_DATA_BASE).join("1.json");
260+
let path = format!("{}/1.json", TEST_DATA_BASE);
262261
let meta = local_unpartitioned_file(path);
263262
let schema = JsonFormat::default()
264263
.infer_schema(&store, &[meta.clone()])

datafusion/core/src/physical_plan/file_format/parquet.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,8 +1239,7 @@ mod tests {
12391239
async fn parquet_exec_with_error() -> Result<()> {
12401240
let session_ctx = SessionContext::new();
12411241
let task_ctx = session_ctx.task_ctx();
1242-
let store_root = std::path::Path::new(env!("CARGO_MANIFEST_DIR"));
1243-
let location = Path::from_filesystem_path(store_root)
1242+
let location = Path::from_filesystem_path(".")
12441243
.unwrap()
12451244
.child("invalid.parquet");
12461245

datafusion/core/src/test_util.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ fn get_data_dir(udf_env: &str, submodule_data: &str) -> Result<PathBuf, Box<dyn
223223
let dir = env!("CARGO_MANIFEST_DIR");
224224

225225
let pb = PathBuf::from(dir).join(submodule_data);
226-
let pb = pb.canonicalize()?;
227226
if pb.is_dir() {
228227
Ok(pb)
229228
} else {
@@ -326,9 +325,9 @@ mod tests {
326325
#[test]
327326
fn test_data_dir() {
328327
let udf_env = "get_data_dir";
329-
let cwd = std::path::Path::new(env!("CARGO_MANIFEST_DIR"));
328+
let cwd = env::current_dir().unwrap();
330329

331-
let existing_pb = cwd.join("..").canonicalize().unwrap();
330+
let existing_pb = cwd.join("..");
332331
let existing = existing_pb.display().to_string();
333332
let existing_str = existing.as_str();
334333

0 commit comments

Comments
 (0)