Github user alope107 commented on a diff in the pull request: https://github.com/apache/spark/pull/8318#discussion_r41212659 --- Diff: python/pyspark/__init__.py --- @@ -36,6 +36,31 @@ Finer-grained cache persistence levels. """ +import os +import sys + +import xml.etree.ElementTree as ET + +if (os.environ.get("SPARK_HOME", "not found") == "not found"): + raise ImportError("Environment variable SPARK_HOME is undefined.") + +spark_home = os.environ['SPARK_HOME'] +pom_xml_file_path = os.path.join(spark_home, 'pom.xml') --- End diff -- Good catch; I hadn't noticed that. The only other standard way I'm seeing to get the version is by instantiating a Java Spark Context and querying its version. Is this acceptable, or is there a more lightweight solution?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org