You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/08/21 00:52:20 UTC
[GitHub] [spark] HyukjinKwon commented on a diff in pull request #37592: [SPARK-40142][PYTHON][SQL][FOLLOW-UP] Make pyspark.sql.functions examples self-contained (part 2, 32 functions)
HyukjinKwon commented on code in PR #37592:
URL: https://github.com/apache/spark/pull/37592#discussion_r950766376
##########
python/pyspark/sql/functions.py:
##########
@@ -6158,12 +6764,14 @@ def _test() -> None:
import doctest
from pyspark.sql import Row, SparkSession
import pyspark.sql.functions
+ import math
globs = pyspark.sql.functions.__dict__.copy()
spark = SparkSession.builder.master("local[4]").appName("sql.functions tests").getOrCreate()
sc = spark.sparkContext
globs["sc"] = sc
globs["spark"] = spark
+ globs["math"] = math
Review Comment:
Let's import this within the docstring. I think we should ideally remove all these globals (except `spark`).
--
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