HyukjinKwon commented on a change in pull request #34993:
URL: https://github.com/apache/spark/pull/34993#discussion_r774350553



##########
File path: python/pyspark/testing/utils.py
##########
@@ -152,7 +153,7 @@ def close(self):
 def search_jar(project_relative_path, sbt_jar_name_prefix, 
mvn_jar_name_prefix):
     # Note that 'sbt_jar_name_prefix' and 'mvn_jar_name_prefix' are used since 
the prefix can
     # vary for SBT or Maven specifically. See also SPARK-26856
-    project_full_path = os.path.join(os.environ["SPARK_HOME"], 
project_relative_path)
+    project_full_path = os.path.join(_find_spark_home(), project_relative_path)

Review comment:
       I think we can just use `pyspark.testing.utils.SPARK_HOME`. SPARK_HOME 
should be set before importing this in our testing script anyway.

##########
File path: python/pyspark/tests/test_appsubmit.py
##########
@@ -23,13 +23,15 @@
 import unittest
 import zipfile
 
+from pyspark.find_spark_home import _find_spark_home
+
 
 class SparkSubmitTests(unittest.TestCase):
     def setUp(self):
         self.programDir = tempfile.mkdtemp()
         tmp_dir = tempfile.gettempdir()
         self.sparkSubmit = [
-            os.path.join(os.environ.get("SPARK_HOME"), "bin", "spark-submit"),
+            os.path.join(_find_spark_home(), "bin", "spark-submit"),

Review comment:
       Here too. Let's just import `pyspark.testing.utils.SPARK_HOME`. I think 
it's fine.




-- 
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to