Shrividya commented on code in PR #54036:
URL: https://github.com/apache/spark/pull/54036#discussion_r3036295021
##########
python/pyspark/sql/functions/builtin.py:
##########
@@ -107,7 +107,8 @@ def _invoke_function(name: str, *args: Any) -> Column:
"""
from pyspark import SparkContext
- assert SparkContext._active_spark_context is not None
+ if SparkContext._active_spark_context is None:
+ raise PySparkException("No active Spark context.")
Review Comment:
nit : a message that says, "No active SparkContext. Please create a
SparkContext before calling PySpark functions." would be more actionable for
someone debugging this.
--
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]