You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "allisonwang-db (via GitHub)" <gi...@apache.org> on 2023/10/26 16:55:18 UTC

Re: [PR] [SPARK-45674][CONNECT][PYTHON] Improve error message for JVM-dependent attributes on Spark Connect. [spark]

allisonwang-db commented on code in PR #43537:
URL: https://github.com/apache/spark/pull/43537#discussion_r1373472305


##########
python/pyspark/sql/connect/session.py:
##########
@@ -694,14 +694,10 @@ def streams(self) -> "StreamingQueryManager":
     streams.__doc__ = PySparkSession.streams.__doc__
 
     def __getattr__(self, name: str) -> Any:
-        if name in ["_jsc", "_jconf", "_jvm", "_jsparkSession"]:
+        if name in ["_jsc", "_jconf", "_jvm", "_jsparkSession", "sparkContext", "newSession"]:
             raise PySparkAttributeError(
                 error_class="JVM_ATTRIBUTE_NOT_SUPPORTED", message_parameters={"attr_name": name}

Review Comment:
   I see this in the error message:`If you need to use this attribute, do not use Spark Connect when creating your session.`
   Could we provide more detailed instructions on how users can "not use" Spark Connect?



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org