You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ma...@apache.org on 2024/02/27 12:52:00 UTC
(spark) branch master updated: [SPARK-47179][SQL] Improve error message from SparkThrowableSuite for better debuggability
This is an automated email from the ASF dual-hosted git repository.
maxgekk 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 9d2fd5e328fd [SPARK-47179][SQL] Improve error message from SparkThrowableSuite for better debuggability
9d2fd5e328fd is described below
commit 9d2fd5e328fd298e8522a7bb9f96c7f014b8f145
Author: Haejoon Lee <ha...@databricks.com>
AuthorDate: Tue Feb 27 15:51:42 2024 +0300
[SPARK-47179][SQL] Improve error message from SparkThrowableSuite for better debuggability
### What changes were proposed in this pull request?
This PR proposes to improve error message from SparkThrowableSuite for better debuggability
### Why are the changes needed?
The current error message is not very actionable for developer who need regenerating the error class documentation.
### Does this PR introduce _any_ user-facing change?
No API change, but the error message is changed:
**Before**
```
The error class document is not up to date. Please regenerate it.
```
**After**
```
he error class document is not up to date. Please regenerate it by running `SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "core/testOnly *SparkThrowableSuite -- -t \"Error classes match with document\""`
```
### How was this patch tested?
The existing CI should pass.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #45273 from itholic/improve_error_suite_debuggability.
Authored-by: Haejoon Lee <ha...@databricks.com>
Signed-off-by: Max Gekk <ma...@gmail.com>
---
.../test/scala/org/apache/spark/SparkThrowableSuite.scala | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/core/src/test/scala/org/apache/spark/SparkThrowableSuite.scala b/core/src/test/scala/org/apache/spark/SparkThrowableSuite.scala
index 1f3b28968025..f41ad8fffd3e 100644
--- a/core/src/test/scala/org/apache/spark/SparkThrowableSuite.scala
+++ b/core/src/test/scala/org/apache/spark/SparkThrowableSuite.scala
@@ -55,6 +55,9 @@ class SparkThrowableSuite extends SparkFunSuite {
"core/testOnly *SparkThrowableSuite -- -t \"Error classes match with document\""
}}}
*/
+ private val regenerateCommand = "SPARK_GENERATE_GOLDEN_FILES=1 build/sbt " +
+ "\"core/testOnly *SparkThrowableSuite -- -t \\\"Error classes match with document\\\"\""
+
private val errorJsonFilePath = getWorkspaceFilePath(
"common", "utils", "src", "main", "resources", "error", "error-classes.json")
@@ -328,7 +331,8 @@ class SparkThrowableSuite extends SparkFunSuite {
}
} else {
assert(subErrorDoc.trim == errorsInDoc.trim,
- "The error class document is not up to date. Please regenerate it.")
+ "The error class document is not up to date. " +
+ s"Please regenerate it by running `$regenerateCommand`")
}
})
@@ -351,7 +355,8 @@ class SparkThrowableSuite extends SparkFunSuite {
}
} else {
assert(sqlErrorParentDoc.trim == commonErrorsInDoc.trim,
- "The error class document is not up to date. Please regenerate it.")
+ "The error class document is not up to date. " +
+ s"Please regenerate it by running `$regenerateCommand`")
}
val orphans = orphanedGoldenFiles()
@@ -368,7 +373,8 @@ class SparkThrowableSuite extends SparkFunSuite {
}
} else {
assert(orphans.isEmpty,
- "Exist orphaned error class documents. Please regenerate it.")
+ "Exist orphaned error class documents. " +
+ s"Please regenerate it by running `$regenerateCommand`")
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org