You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/11/28 08:45:19 UTC

[GitHub] [spark] MaxGekk commented on a diff in pull request #38728: [SPARK-41204] [CONNECT] Migrate custom exceptions to use Spark exceptions

MaxGekk commented on code in PR #38728:
URL: https://github.com/apache/spark/pull/38728#discussion_r1033260567


##########
connector/connect/src/test/scala/org/apache/spark/sql/connect/planner/SparkConnectPlannerSuite.scala:
##########
@@ -329,19 +346,25 @@ class SparkConnectPlannerSuite extends SparkFunSuite with SparkConnectPlanTest {
       .setAllColumnsAsKeys(true)
       .addColumnNames("test")
 
-    val e = intercept[InvalidPlanInput] {
-      transform(proto.Relation.newBuilder.setDeduplicate(deduplicate).build())
-    }
-    assert(
-      e.getMessage.contains("Cannot deduplicate on both all columns and a subset of columns"))
+    checkError(
+      exception = intercept[InvalidPlanInput] {
+        transform(proto.Relation.newBuilder.setDeduplicate(deduplicate).build())
+      },
+      errorClass = "CONNECT.INVALID_PLAN_INPUT",
+      parameters = Map("msg" -> "Cannot deduplicate on both all columns and a subset of columns"))

Review Comment:
   Would it possible to move all the plain text to `error-classes.json`. Could you image that we will translate errors to local languages in the future, or tech editors will fix some typos in the texts. In your case, we will have to rebuild Spark which is not nice approach.



-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org