HyukjinKwon commented on code in PR #39249: URL: https://github.com/apache/spark/pull/39249#discussion_r1058682621
########## python/pyspark/sql/connect/column.py: ########## @@ -390,3 +391,61 @@ def __nonzero__(self) -> None: Column.__doc__ = PySparkColumn.__doc__ + + +def _test() -> None: + import os + import sys + import doctest + from pyspark.sql import SparkSession as PySparkSession + from pyspark.testing.connectutils import should_test_connect, connect_requirement_message + + os.chdir(os.environ["SPARK_HOME"]) + + if should_test_connect: + import pyspark.sql.connect.column + + globs = pyspark.sql.connect.column.__dict__.copy() + # Works around to create a regular Spark session + sc = SparkContext("local[4]", "sql.connect.column tests", conf=SparkConf()) + globs["_spark"] = PySparkSession(sc, options={"spark.app.name": "sql.connect.column tests"}) + + # Creates a remote Spark session. + os.environ["SPARK_REMOTE"] = "sc://localhost" + globs["spark"] = PySparkSession.builder.remote("sc://localhost").getOrCreate() + + # TODO(SPARK-41751): Support bitwiseAND + del pyspark.sql.connect.column.Column.bitwiseAND.__doc__ + del pyspark.sql.connect.column.Column.bitwiseOR.__doc__ + del pyspark.sql.connect.column.Column.bitwiseXOR.__doc__ + del pyspark.sql.connect.column.Column.eqNullSafe.__doc__ + del pyspark.sql.connect.column.Column.isNotNull.__doc__ + del pyspark.sql.connect.column.Column.isNull.__doc__ + del pyspark.sql.connect.column.Column.isin.__doc__ + # TODO: Fix createDataFrame Review Comment: Let's file a JIRA -- 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-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org