This is an automated email from the ASF dual-hosted git repository.
gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 79cee25d1d9a [MINOR] Remove unnecessary df.show() in tests
79cee25d1d9a is described below
commit 79cee25d1d9a0fcc49596885a17a7ffd14868d85
Author: dengziming <[email protected]>
AuthorDate: Mon Jul 21 08:51:24 2025 +0900
[MINOR] Remove unnecessary df.show() in tests
### What changes were proposed in this pull request?
Remove df.show() to avoid unnecessary output.
### Why are the changes needed?
It's not recommended to print anything in the output, we disallowed
`println` in scalastyle, but it's difficult to make df.show() a scalastyle rule.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
No.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #51578 from dengziming/remove-show.
Authored-by: dengziming <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
---
sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala | 1 -
.../org/apache/spark/sql/execution/command/DescribeTableSuiteBase.scala | 2 --
2 files changed, 3 deletions(-)
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
b/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
index 70f891b84f09..2ad851b7a9e2 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
@@ -111,7 +111,6 @@ class SQLQuerySuite extends QueryTest with
SharedSparkSession with AdaptiveSpark
}
test("SPARK-34678: describe functions for table-valued functions") {
- sql("describe function range").show(false)
checkKeywordsExist(sql("describe function range"),
"Function: range",
"Class: org.apache.spark.sql.catalyst.plans.logical.Range",
diff --git
a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DescribeTableSuiteBase.scala
b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DescribeTableSuiteBase.scala
index 9d34b6725c4f..1ea75ccb09d8 100644
---
a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DescribeTableSuiteBase.scala
+++
b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DescribeTableSuiteBase.scala
@@ -252,7 +252,6 @@ trait DescribeTableSuiteBase extends QueryTest with
DDLCommandTestUtils {
df.write.mode("append").clusterBy("col1", "col2.x").saveAsTable(tbl)
val descriptionDf = sql(s"DESC $tbl")
- descriptionDf.show(false)
assert(descriptionDf.schema.map(field => (field.name, field.dataType))
=== Seq(
("col_name", StringType),
("data_type", StringType),
@@ -277,7 +276,6 @@ trait DescribeTableSuiteBase extends QueryTest with
DDLCommandTestUtils {
df.writeTo(tbl).clusterBy("col1", "col2.x").create()
val descriptionDf = sql(s"DESC $tbl")
- descriptionDf.show(false)
assert(descriptionDf.schema.map(field => (field.name, field.dataType))
=== Seq(
("col_name", StringType),
("data_type", StringType),
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]