Skip to content

Commit 20fb01b

Browse files
committed
[MINOR][PYTHON] Remove explain(True) in test_udf.py
## What changes were proposed in this pull request? Not a big deal but it bugged me. This PR removes printing out plans in PySpark UDF tests. Before: ``` Running tests... ---------------------------------------------------------------------- Setting default log level to "WARN". To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel). == Parsed Logical Plan == GlobalLimit 1 +- LocalLimit 1 +- Project [id#668L, <lambda>(id#668L) AS copy#673] +- Sort [id#668L ASC NULLS FIRST], true +- Range (0, 10, step=1, splits=Some(4)) == Analyzed Logical Plan == id: bigint, copy: int GlobalLimit 1 +- LocalLimit 1 +- Project [id#668L, <lambda>(id#668L) AS copy#673] +- Sort [id#668L ASC NULLS FIRST], true +- Range (0, 10, step=1, splits=Some(4)) == Optimized Logical Plan == GlobalLimit 1 +- LocalLimit 1 +- Project [id#668L, pythonUDF0#676 AS copy#673] +- BatchEvalPython [<lambda>(id#668L)], [id#668L, pythonUDF0#676] +- Range (0, 10, step=1, splits=Some(4)) == Physical Plan == CollectLimit 1 +- *(2) Project [id#668L, pythonUDF0#676 AS copy#673] +- BatchEvalPython [<lambda>(id#668L)], [id#668L, pythonUDF0#676] +- *(1) Range (0, 10, step=1, splits=4) ........................................... ---------------------------------------------------------------------- Ran 43 tests in 19.777s ``` After: ``` Running tests... ---------------------------------------------------------------------- Setting default log level to "WARN". To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel). ........................................... ---------------------------------------------------------------------- Ran 43 tests in 25.201s ``` ## How was this patch tested? N/A Closes apache#24661 from HyukjinKwon/remove-explain-in-test. Authored-by: HyukjinKwon <[email protected]> Signed-off-by: HyukjinKwon <[email protected]>
1 parent 604aa1b commit 20fb01b

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

python/pyspark/sql/tests/test_udf.py

-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ def test_udf_with_order_by_and_limit(self):
326326
my_copy = udf(lambda x: x, IntegerType())
327327
df = self.spark.range(10).orderBy("id")
328328
res = df.select(df.id, my_copy(df.id).alias("copy")).limit(1)
329-
res.explain(True)
330329
self.assertEqual(res.collect(), [Row(id=0, copy=0)])
331330

332331
def test_udf_registration_returns_udf(self):

0 commit comments

Comments
 (0)