jackwener commented on code in PR #9259:
URL: https://github.com/apache/arrow-datafusion/pull/9259#discussion_r1496883772


##########
datafusion/sql/src/planner.rs:
##########
@@ -563,3 +570,13 @@ pub fn object_name_to_qualifier(
         .collect::<Vec<_>>()
         .join(" AND ")
 }
+#[test]
+fn test_substitute_tilde_with_home() {
+    std::env::set_var("HOME", "/home/user");
+    let input = 
"~/Code/arrow-datafusion/benchmarks/data/tpch_sf1/part/part-0.parquet";
+    let expected =
+        
"/home/user/Code/arrow-datafusion/benchmarks/data/tpch_sf1/part/part-0.parquet";
+    let actual = substitute_tilde(input.to_string());
+    assert_eq!(actual, expected);
+    std::env::remove_var("HOME");
+}

Review Comment:
   add a new test to cover the  case when we don't set "HOME" variable



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to