Skip to content

Commit 78e9f70

Browse files
LuciferYangdongjoon-hyun
authored andcommitted
[SPARK-54174][CORE][CONNECT][TESTS] Remove override of deprecated method SparkThrowable#getErrorClass in Spark code
### What changes were proposed in this pull request? This pr removes the override of the deprecated method `SparkThrowable#getErrorClass` from the Spark codebase. Since this method has been marked as deprecated and is defined as `default String getErrorClass() { return getCondition(); }`, the overriding behavior for it can be omitted based on the current code. ### Why are the changes needed? Code Cleanup ### Does this PR introduce _any_ user-facing change? No, this only involves test code. ### How was this patch tested? Pass Github Actions ### Was this patch authored or co-authored using generative AI tooling? No Closes #52868 from LuciferYang/cleanup-override-getErrorClass. Lead-authored-by: yangjie01 <yangjie01@baidu.com> Co-authored-by: YangJie <yangjie01@baidu.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
1 parent bdac5cd commit 78e9f70

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

core/src/test/scala/org/apache/spark/SparkThrowableSuite.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,6 @@ class SparkThrowableSuite extends SparkFunSuite {
620620
// Create a custom throwable that overrides getDefaultMessageTemplate.
621621
class CustomTemplatedThrowable extends Throwable with SparkThrowable {
622622
override def getCondition: String = "DIVIDE_BY_ZERO"
623-
override def getErrorClass: String = "DIVIDE_BY_ZERO"
624623
override def getMessage: String = "Custom message"
625624
override def getMessageParameters: java.util.Map[String, String] =
626625
Map("config" -> "TEST_CONFIG").asJava
@@ -643,7 +642,6 @@ class SparkThrowableSuite extends SparkFunSuite {
643642
// Create a throwable that uses default getDefaultMessageTemplate implementation.
644643
class ReadFromJSONThrowable extends Throwable with SparkThrowable {
645644
override def getCondition: String = "DIVIDE_BY_ZERO"
646-
override def getErrorClass: String = "DIVIDE_BY_ZERO"
647645
override def getMessage: String = "Random message"
648646
override def getMessageParameters: java.util.Map[String, String] =
649647
Map("config" -> "TEST_CONFIG").asJava
@@ -665,7 +663,6 @@ class SparkThrowableSuite extends SparkFunSuite {
665663
// Create a throwable with non-existing error condition.
666664
class NonExistingConditionThrowable extends Throwable with SparkThrowable {
667665
override def getCondition: String = "NON_EXISTING_ERROR_CONDITION"
668-
override def getErrorClass: String = "NON_EXISTING_ERROR_CONDITION"
669666
override def getMessage: String = "Non-existing error message"
670667
override def getMessageParameters: java.util.Map[String, String] =
671668
Map("param" -> "value").asJava

sql/connect/server/src/test/scala/org/apache/spark/sql/connect/service/FetchErrorDetailsHandlerSuite.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class TestSparkThrowableWithBreakingChange(
4646
with SparkThrowable {
4747

4848
override def getCondition: String = errorClass
49-
override def getErrorClass: String = errorClass
5049
override def getMessageParameters: java.util.Map[String, String] = {
5150
import scala.jdk.CollectionConverters._
5251
messageParams.asJava

0 commit comments

Comments
 (0)